home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 13 / CU Amiga Magazine's Super CD-ROM 13 (1997)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1997-08].iso / CUCD / Graphics / irit70 / bin / irit.hlp < prev    next >
Text File  |  1997-05-01  |  326KB  |  8,984 lines

  1.  
  2.  
  3.  IRIT Version 7.0 User's Manual 
  4.  
  5.  A Solid modeling Program 
  6.  
  7.  Copyright (C) 1989, 1990-1997 Gershon Elber
  8.  
  9.  EMail: gershon@cs.technion.ac.il
  10.  
  11.  Join IRIT mailing list: gershon@cs.technion.ac.il
  12.  Mailing list: irit-mail@cs.technion.ac.il
  13.  Bug reports: irit-bugs@cs.technion.ac.il
  14.  WWW Page: http://www.cs.technion.ac.il/~irit
  15.  
  16. Introduction
  17.  
  18.    IRIT is a solid modeler developed for educational purposes. Although
  19.  small, it is now powerful enough to create quite complex scenes.
  20.  
  21.    IRIT started as a polygonal solid modeler and was originally developed
  22.  on an IBM PC under MSDOS. Version 2.0 was also ported to X11 and version 3.0
  23.  to SGI 4D systems. Version 3.0 also includes quite a few free form curves
  24.  and surfaces tools. See the UPDATE.NEW file for more detailed update
  25.  information. In Version 4.0, the display devices were enhanced, freeform
  26.  curves and surfaces have further support, functions can be defined, and
  27.  numerous improvement and optimizations are added.
  28. $
  29.  
  30. COPYRIGHTS
  31.  
  32.    BECAUSE IRIT AND ITS SUPPORTING TOOLS AS DOCUMENTED IN THIS DOCUMENT
  33.  ARE LICENSED FREE OF CHARGE, I PROVIDE ABSOLUTELY NO WARRANTY, TO THE EXTENT
  34.  PERMITTED BY APPLICABLE STATE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING, I
  35.  GERSHON ELBER PROVIDE THE IRIT PROGRAM AND ITS SUPPORTING TOOLS "AS IS"
  36.  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
  37.  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  38.  PARTICULAR PURPOSE.
  39.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THESE PROGRAMS IS WITH
  40.  YOU. SHOULD THE IRIT PROGRAMS PROVE DEFECTIVE, YOU ASSUME THE COST OF
  41.  ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  42.  
  43.    IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL GERSHON ELBER,
  44.  BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES,
  45.  OR OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
  46.  USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR A
  47.  FAILURE OF THE PROGRAMS TO OPERATE WITH PROGRAMS NOT DISTRIBUTED BY GERSHON
  48.  ELBER) THE PROGRAMS, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF
  49.  SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
  50.  
  51.  
  52.    IRIT is a freeware solid modeler. It is not public domain since I
  53.  hold copyrights on it. However, unless you are to sell or attempt to make
  54.  money from any part of this code and/or any model you made with this solid
  55.  modeler, you are free to make anything you want with it.
  56.  
  57.    IRIT can be compiled and executed on numerous Unix systems as well
  58.  as OS2, Windows NT/95 and AmigaDOS. However, beware the MSDOS support is
  59.  fading away.
  60.  
  61.    You are not obligated to me or to anyone else in any way by using IRIT.
  62.    You are encouraged to share any model you made with it, but the models
  63.  you made with it are yours, and you have no obligation to share them.
  64.    You can use this program and/or any model created with it for non
  65.  commercial and non profit purposes only. An acknowledgement on the way the
  66.  models were created would be nice but is not required.
  67. $
  68.  
  69. Setup
  70.  
  71.    The IRIT program reads a file called irit.cfg each time it is executed.
  72.    This file configures the system. It is a regular text file with comments, so
  73.  you can edit it and properly modify it for your environment.
  74.    This file is being searched for in the directory specified by the
  75.  IRIT_PATH environment variable.
  76.    For example 'setenv IRIT_PATH /u/gershon/irit/bin/'.
  77.    Note IRIT_PATH must terminate with '/'. If the variable is not set only
  78.  the current directory is being searched for irit.cfg.
  79.  
  80.    In addition, if it exists, a file by the name of iritinit.irt will be
  81.  automatically executed before any other '.irt' file. This file may contain
  82.  any IRIT command. It is the proper place to put your predefined
  83.  functions and procedures if you have some.
  84.    This file will be searched much the same way IRIT.CFG is. The
  85.  name of this initialization file may be changed by setting the StartFile
  86.  entry in the configuration file.
  87.    This file is far more important starting at version 4.0, because of the new
  88.  function and procedure definition that has been added, and which is used
  89.  to emulate BEEP, VIEW, and INTERACT for example.
  90.  
  91.    The solid modeler can be executed in text mode (see the .cfg and the -t
  92.  flag below) on virtually any system with a C compiler.
  93.  
  94.   Under all systems the following environment variables must be set
  95.  and updated:
  96.  
  97.     path           Add to path the directory where IRIT's binaries are.
  98.     IRIT_PATH      Directory with config., help and IRIT's binary files.
  99.     IRIT_DISPLAY   The graphics driver program/options. Must be in path.
  100.     IRIT_BIN_IPC   If set, uses binary Inter Process Communication.
  101.  
  102.  
  103.  For example,
  104.  
  105.    set path = (path /u/gershon/irit/bin)
  106.    setenv IRIT_PATH  /u/gershon/irit/bin/
  107.    setenv IRIT_DISPLAY "xgldrvs -s-"
  108.    setenv IRIT_BIN_IPC 1
  109.  
  110.  to set /u/gershon/irit/bin as the binary directory and to use the sgi's
  111.  gl driver. If IRIT_DISPLAY is not set, the server (i.e., the IRIT
  112.  program) will prompt and wait for you to run a client (i.e., a display
  113.  driver). if IRIT_PATH is not set, none of the configuration files, nor
  114.  the help file will be found.
  115.  
  116.  If IRIT_BIN_IPC is not set, text based IPC is used, which is far
  117.  slower. No real reason not to use IRIT_BIN_IPC, unless it does not
  118.  work for you.
  119.  
  120.   In addition, the following optional environment variables may be set.
  121.  
  122.     IRIT_MALLOC       If set, apply dynamic memory consistency testing.
  123.                       Programs will execute much slower in this mode.
  124.     IRIT_MALLOC_PTR   Set to a pointer address and the program will scream
  125.                       once this pointer is allocated, if IRIT_MALLOC is set.
  126.     IRIT_NO_SIGNALS   If set, no signals are caught by IRIT.
  127.     IRIT_SERVER_HOST  Internet Name of IRIT server (used by graphics driver).
  128.     IRIT_SERVER_PORT  Used internally to the TCP socket number. Should not
  129.                       be set by users.
  130.     LD_LIBRARY_PATH   If shared libraries are created, this variable must be
  131.                       updated to point to the shared libraries' directory.
  132.  
  133.  
  134.  For example,
  135.  
  136.    setenv IRIT_MALLOC 1
  137.    setenv IRIT_MALLOC_PTR 1234567890
  138.    setenv IRIT_NO_SIGNALS 1
  139.    setenv IRIT_SERVER_HOST irit.cs.technion.ac.il
  140.  
  141.  IRIT_MALLOC is useful for programmers, or when reporting a memory
  142.  fatal error occurrence.  This variable, when set as a non zero value
  143.  will activate the following (hexadecimal bit settings with any combination
  144.  of the following):
  145.  
  146.     0x01       A test for overwriting before the dynamic memory
  147.                allocated or immediately after it. Cheap in time.
  148.     0x02       Savings of all allocated objects in a table for the
  149.                detection of freeing unallocated objects and consistency
  150.                of the entire dynamic memory. Expensive in time.
  151.     0x04       Zeros every freed object, once it is freed.
  152.  
  153.  
  154.  IRIT_NO_SIGNALS is also useful for debugging when contorl-C is used
  155.  within a debugger. The IRIT_SERVER_HOST/PORT controls the server/client
  156.  (IRIT/Display device) communication.
  157.  
  158.  IRIT_SERVER_HOST and IRIT_SERVER_PORT are used in the unix and
  159.  Window NT ports of IRIT.
  160.  
  161.    See the section on the graphics drivers for more details.
  162.  
  163.    A session can be logged into a file as set via LogFile in the configuration
  164.  file. See also the LOGFILE command.
  165.  
  166.    The following command line options are available:
  167.  
  168.    IRIT [-t] [-z] [file.irt]
  169.  
  170.  
  171.     -t          Puts IRIT into text mode. No graphics will be displayed and
  172.                 the display commands will be ignored. Useful when one needs to
  173.                 execute an irt file to create data on a tty device...
  174.     -z          Prints usage message and current configuration/version
  175.                 information.
  176.     file.irt    A file to invoke directly instead of waiting to input from
  177.                 stdin. 
  178.  
  179.  
  180.  
  181.  Under OS2 the IRIT_DISPLAY environment variable must be set (if set) to
  182.  os2drvs.exe without any option (-s- will be passed automatically).
  183.  os2drvs.exe must be in a directory that is in the PATH environment
  184.  variable. IRIT_BIN_IPC can be used to signal binary IPC which is faster.
  185.  Here is a complete example:
  186.  
  187.  set IRIT_PATH=c:\irit\bin\
  188.  set IRIT_DISPLAY=os2drvs -s-
  189.  set IRIT_BIN_IPC=1
  190.  
  191.  assuming the directory specified by IRIT_PATH holds the executables of
  192.  IRIT and is in PATH.
  193.  
  194.  If IRIT_BIN_IPC is not set, text based IPC is used which is far
  195.  slower. No real reason not to use IRIT_BIN_IPC unless it does not
  196.  work for you.
  197.  
  198.  The OS2 executables are typically built using the EMX port of gnu C
  199.  compiler.  The distribution of the executables does not include the run
  200.  time library of EMX and attempt to run IRIT will fail with error message
  201.  like "File EMX does not exist".  You will need to get the run time from
  202.  
  203.         ftp to ftp-os2.nmsu.edu (aliased also as hobbes.NMSU.Edu)
  204.         cd to os2/unix/emx09c   (or a newer version number/level)
  205.         get emxrt.zip and place its dlls in a place they would be found.
  206.  
  207.  
  208.  The NT port uses sockets and is, in this respect, similar to the unix port.
  209.  The envirnoment variables IRIT_DISPLAY, IRIT_SERVER_HOST,
  210.  IRIT_BIN_IPC should all be set in a similar way to the Unix specific setup.
  211.  As a direct result, the server (IRIT) and the display device may be running
  212.  on different hosts. For example the server might be running on an NT system
  213.  while the display device will be running on an SGI4D exploiting the graphic's
  214.  hardware capabilities.  Here is a complete example:
  215.  
  216.  set IRIT_PATH=c:\irit\bin\
  217.  set IRIT_DISPLAY=wntgdrvs -s-
  218.  set IRIT_BIN_IPC=1
  219.  
  220.    Under UNIX using X11 (x11drvs driver) add the following options to
  221.  your .Xdefaults. Most are self explanatory. The Trans attributes control
  222.  the transformation window, while the View attributes control the view window.
  223.  SubWin attributes control the subwindows within the Transformation window.
  224.  
  225.     #if COLOR                                                        
  226.     irit*Trans*BackGround:            NavyBlue                       
  227.     irit*Trans*BorderColor:           Red                            
  228.     irit*Trans*BorderWidth:           3                              
  229.     irit*Trans*TextColor:             Yellow                         
  230.     irit*Trans*SubWin*BackGround:     DarkGreen                      
  231.     irit*Trans*SubWin*BorderColor:    Magenta                        
  232.     irit*Trans*Geometry:              =150x500+500+0                 
  233.     irit*Trans*CursorColor:           Green                          
  234.     irit*View*BackGround:             NavyBlue                       
  235.     irit*View*BorderColor:            Red                            
  236.     irit*View*BorderWidth:            3                              
  237.     irit*View*Geometry:               =500x500+0+0                   
  238.     irit*View*CursorColor:            Red                            
  239.     irit*MaxColors:                   15                             
  240.     #else                                                            
  241.     irit*Trans*Geometry:              =150x500+500+0                 
  242.     irit*Trans*BackGround:            Black                          
  243.     irit*View*Geometry:               =500x500+0+0                   
  244.     irit*View*BackGround:             Black                          
  245.     irit*MaxColors:                   1                              
  246.     #endif                                                           
  247.  
  248. $
  249.  
  250. First Usage
  251.  
  252.    Commands to IRIT are entered using a textual interface, usually
  253.  from the same window the program was executed from.
  254.  
  255.    Some important commands to begin with are,
  256.  
  257.    1. include("file.irt"); - will execute the commands in file.irt. Note
  258.       include can be recursive up to 10 levels. To execute the demo
  259.       (demo.irt) simply type 'include("demo.irt");'. Another way to run
  260.       the demo is by typing demo(); which is a predefined procedure defined
  261.       in iritinit.irt.
  262.  
  263.    2. help(""); - will print all available commands and how to get help on
  264.       them. A file called irit.hlp will be searched as irit.cfg is
  265.       being searched (see above), to provide the help.
  266.  
  267.    3. exit(); - close everything and exit IRIT.
  268.  
  269.    Most operators are overloaded. This means that you can multiply
  270.  two scalars (numbers), or two vectors, or even two matrices, with the same
  271.  multiplication operator (*). To get the on-line help on the
  272.  operator '*' type 'help("*");'
  273.  
  274.    The best way to learn this program (like any other program...) is by
  275.  trying it. Print the manual and study each of the commands available.
  276.    Study the demo programs (*.irt) provided as well.
  277.  
  278.    The "best" mode to use irit is via the emacs editor. With this distribution
  279.  an emacs mode for irit files (irt postfix) is provided (irit.el). Make your
  280.  .emacs load this file automatically. Loading file.irt will switch emacs into
  281.  Irit mode that supports the following three keystrokes:
  282.  
  283.     Meta-E             Executes the current line
  284.     Meta-R             Executes the current Region (Between Cursor and Mark)
  285.     Meta-S             Executes a single line from input buffer
  286.  
  287.    The first time one of the above keystrokes is hit, emacs will fork an Irit
  288.  process so that Irit's stdin is controlled via the above commands.
  289.    This emacs mode was tested under various unix environments, under OS2
  290.  2.x/3.x, and under Windows NT 3.x/4.x and Windows 95.
  291. $
  292.  
  293. Data Types
  294.   These are the Data Types recognized by the solid modeler. They are also
  295.  used to define the calling sequences of the different functions below:
  296.  
  297.     ConstantType       Scalar real type that cannot be modified.
  298.     NumericType        Scalar real type.
  299.     VectorType         3D real type vector.
  300.     PointType          3D real type point.
  301.     CtlPtType          Control point of a freeform curve or surface.
  302.     MatrixType         4 by 4 matrix (homogeneous transformation matrix).
  303.     PolygonType        Object consists of polygons.
  304.     PolylineType       Object consists of polylines.
  305.     CurveType          Object consists of curves.
  306.     SurfaceType        Object consists of surfaces.
  307.     TrimSrfType        Object consists of trimmed surfaces.
  308.     TriSrfType         Object consists of triangular surfaces
  309.     TrivarType         Object consists of trivariate functions.
  310.     GeometricType      One of Polygon/lineType, CurveType, SurfaceType,
  311.                        TrimSrfType, TrivarType, TriSrfType.
  312.     InstanceType       Object with a GeometryType and a Transformation.
  313.     GeometricTreeType  A list of GeometricTypes or GeometricTreeTypes.
  314.     StringType         Sequence of chars within double quotes - "A string".
  315.                        Current implementation is limited to 80 chars.
  316.     AnyType            Any of the above.
  317.     ListType           List of (any of the above type) objects. List 
  318.                        size is dynamically increased, as needed.
  319.  
  320.   Although points and vectors are not the same, IRIT does not
  321.  destinguish between them, most of the time. This might change in the future.
  322. $
  323.  
  324. Commands
  325.  
  326.  These are all the commands and operators supported by the IRIT solid
  327.  modeler:
  328.  
  329.  
  330.     +          CHDIR      CZEROS     LN         SBEZIER    SYMBSUM   
  331.     -          CINFLECT   DSTPTLN    LOAD       SBISECTOR  SYSTEM    
  332.     *          CINTERP    DSTPTPLN   LOFFSET    SBSPLINE   TAN       
  333.     /          CIRCLE     DSTLNLN    LOG        SCALE      TBEZIER   
  334.     ^          CIRCPOLY   ERROR      LOGFILE    SCRVTR     TBSPLINE  
  335.     =          CLNTCLOSE  EVOLUTE    MERGEPOLY  SDERIVE    TCRVTR    
  336.     ==         CLNTEXEC   EXIT       MESHSIZE   SDIVIDE    TDERIVE   
  337.     !=         CLNTREAD   EXP        MOFFSET    SEDITPT    TEDITPT   
  338.     <          CLNTWRITE  EXTRUDE    MOMENT     SEVAL      TEVAL     
  339.     >          CMESH      FFCOMPAT   MRCHCUBE   SFOCAL     TEXTGEOM  
  340.     <=         CMORPH     FFCTLPTS   MSLEEP     SFROMCRVS  TFROMSRFS 
  341.     >=         CMULTIRES  FFEXTREME  NIL        SGAUSS     TIME      
  342.     ABS        CNORMAL    FFKNTVEC   NTH        SIN        TINTERP   
  343.     ACOS       COERCE     FFMATCH    OFFSET     SINTERP    THISOBJ   
  344.     ADAPISO    COLOR      FFMERGE    ORTHOTOMC  SIZEOF     TMORPH    
  345.     ARC        COMMENT    FFMSIZE    PAUSE      SMEANSQR   TORUS     
  346.     AREA       COMPOSE    FFORDER    PCIRCLE    SMERGE     TRAISE    
  347.     ASIN       CON2       FFPOLES    PDECIMATE  SMORPH     TRANS     
  348.     ATAN       CONE       FFPTDIST   PDOMAIN    SNOC       TREFINE   
  349.     ATAN2      CONTOUR    FFPTTYPE   PLN3PTS    SNORMAL    TREGION   
  350.     ATTRIB     CONVEX     FFSPLIT    POLY       SNRMLSRF   TREPARAM  
  351.     AOFFSET    COORD      FLOOR      POWER      SPHERE     TRIANGL   
  352.     AWIDTH     COS        FMOD       PRINTF     SQRT       TRIMSRF   
  353.     BBOX       COVERISO   FOR        PRISA      SRAISE     TSBEZIER  
  354.     BOOLONE    COVERPT    FREE       PROCEDURE  SREFINE    TSBSPLINE 
  355.     BOOLSUM    CPOLY      FUNCTION   PT3BARY    SREGION    TSDERIVE  
  356.     BOX        CRAISE     GBOX       PTHMSPR    SREPARAM   TSEVAL    
  357.     BSP2BZR    CREFINE    GETATTR    PTLNPLN    SRINTER    TSNORMAL  
  358.     BZR2BSP    CREGION    GETLINE    PTPTLN     STANGENT   TVLOAD,   
  359.     CBEZIER    CREPARAM   GPOLYGON   PTSLNLN    STRIMSRF   VARLIST   
  360.     CBISECTOR  CROSSEC    GPOLYLINE  RANDOM     STRIVAR    VECTOR    
  361.     CBSPLINE   CRV2TANS   HELP       RMATTR     SURFPREV   VIEW      
  362.     CCINTER    CRVLNDST   HERMITE    ROTVEC     SURFREV    VIEWOBJ   
  363.     CCRVTR     CRVPTDST   HOMOMAT    ROTX       SVISIBLE   VOLUME    
  364.     CDERIVE    CRVPTTAN   IF         ROTY       SWEEPSRF   WHILE     
  365.     CDIVIDE    CSURFACE   INCLUDE    ROTZ       SWPSCLSRF            
  366.     CEDITPT    CTANGENT   INSTANCE   ROTZ2V,    SYMBCPROD            
  367.     CENVOFF    CTLPT      INTERACT   ROTZ2V2,   SYMBDIFF             
  368.     CEVAL      CTRIMSRF   IRITSTATE  RULEDSRF   SYMBDPROD            
  369.     CEXTREMES  CYLIN      LIST       SAVE       SYMBPROD             
  370.  
  371. $
  372.  
  373. Functions and Variables
  374.  
  375.  Functions that return a NumericType:
  376.  
  377.     ABS        COS        EXP        POWER      THISOBJ   
  378.     ACOS       CLNTEXEC   FLOOR      RANDOM     VOLUME    
  379.     AREA       CPOLY      FMOD       SIN                  
  380.     ASIN       DSTPTLN    LN         SIZEOF               
  381.     ATAN       DSTPTPLN   LOG        SQRT                 
  382.     ATAN2      DSTLNLN    MESHSIZE   TAN                  
  383.  
  384.  
  385.  Functions that return a GeometricType:
  386.  
  387.     ADAPISO    CON2       FFORDER    PTSLNLN    SWEEPSRF  
  388.     ARC        CONE       FFPOLES    RULEDSRF   SWPSCLSRF 
  389.     AOFFSET    CONTOUR    FFPTDIST   SBEZIER    SYMBCPROD 
  390.     BBOX       CONVEX     FFPTTYPE   SBISECTOR  SYMBDIFF  
  391.     BOOLONE    COORD      FFSPLIT    SBSPLINE   SYMBDPROD 
  392.     BOOLSUM    COVERISO   GBOX       SCRVTR     SYMBPROD  
  393.     BOX        COVERPT    GETATTR    SDERIVE    SYMBSUM   
  394.     BSP2BZR    CRAISE     GETLINE    SDIVIDE    TBEZIER   
  395.     BZR2BSP    CREFINE    GPOLYGON   SEDITPT    TBSPLINE  
  396.     CBEZIER    CREGION    GPOLYLINE  SEVAL      TCRVTR    
  397.     CBISECTOR  CREPARAM   HERMITE    SFOCAL     TDERIVE   
  398.     CBSPLINE   CROSSEC    INSTANCE   SFROMCRVS  TEDITPT   
  399.     CCINTER    CRV2TANS   LOFFSET    SGAUSS     TEVAL     
  400.     CCRVTR     CRVLNDST   MERGEPOLY  SINTERP    TEXTGEOM  
  401.     CDERIVE    CRVPTDST   MOFFSET    SMEANSQR   TFROMSRFS 
  402.     CDIVIDE    CRVPTTAN   MOMENT     SMERGE     TINTERP   
  403.     CEDITPT    CSURFACE   MRCHCUBE   SMORPH     TMORPH    
  404.     CENVOFF    CTANGENT   NIL        SNORMAL    TORUS     
  405.     CEVAL      CTRIMSRF   OFFSET     SNRMLSRF   TRAISE    
  406.     CEXTREMES  CTLPT      ORTHOTOMC  SPHERE     TREFINE   
  407.     CINFLECT   CYLIN      PCIRCLE    SRAISE     TREGION   
  408.     CINTERP    CZEROS     PDECIMATE  SREFINE    TREPARAM  
  409.     CIRCLE     EVOLUTE    PDOMAIN    SREGION    TRIANGL   
  410.     CIRCPOLY   EXTRUDE    PLN3PTS    SREPARAM   TRIMSRF   
  411.     CLNTREAD   FFCOMPAT   POLY       SRINTER    TSBEZIER  
  412.     CMESH      FFCTLPTS   PRISA      STANGENT   TSBSPLINE 
  413.     CMORPH     FFEXTREME  PROCEDURE  STRIMSRF   TSDERIVE  
  414.     CMULTIRES  FFKNTVEC   PT3BARY    STRIVAR    TSEVAL    
  415.     CNORMAL    FFMATCH    PTHMSPR    SURFPREV   TSNORMAL  
  416.     COERCE     FFMERGE    PTLNPLN    SURFREV    TVLOAD    
  417.     COMPOSE    FFMSIZE    PTPTLN     SVISIBLE             
  418.  
  419.  
  420.  Functions that create linear transformation matrices:
  421.  
  422.     HOMOMAT    ROTX       ROTZ       ROTZ2V2    TRANS     
  423.     ROTVEC     ROTY       ROTZ2V     SCALE                
  424.  
  425.  
  426.  Miscellaneous functions:
  427.  
  428.     ATTRIB     ERROR      INCLUDE    NTH        SYSTEM    
  429.     AWIDTH     EXIT       INTERACT   PAUSE      TIME      
  430.     CHDIR      FOR        IRITSTATE  PRINTF     VARLIST   
  431.     CLNTCLOSE  FREE       LIST       PROCEDURE  VECTOR    
  432.     CLNTWRITE  FUNCTION   LOAD       RMATTR     VIEW      
  433.     COLOR      HELP       LOGFILE    SAVE       VIEWOBJ   
  434.     COMMENT    IF         MSLEEP     SNOC       WHILE     
  435.  
  436.  
  437.  Variables that are predefined in the system:
  438.  
  439.     AXES              MACHINE           POLY_APPROX_TOL   VIEW_MAT         
  440.     DRAWCTLPT         POLY_APPROX_OPT   PRSP_MAT                           
  441.     FLAT4PLY          POLY_APPROX_UV    RESOLUTION                         
  442.  
  443.  
  444.  Constants that are predefined in the system:
  445.  
  446.     AMIGA        E3           MAGENTA      PARAM_CENTRIP SURFACE_TYPE
  447.     APOLLO       E4           MATRIX_TYPE  PARAM_CHORD  SUN         
  448.     BLACK        E5           MSDOS        PARAM_UNIFORM TRIMSRF_TYPE
  449.     BLUE         FALSE        NUMERIC_TYPE PI           TRIVAR_TYPE 
  450.     COL          GREEN        OFF          PLANE_TYPE   TRUE        
  451.     CTLPT_TYPE   HP           ON           POINT_TYPE   UNDEF_TYPE  
  452.     CURVE_TYPE   IBMOS2       P1           POLY_TYPE    UNIX        
  453.     CYAN         IBMNT        P2           RED          VECTOR_TYPE 
  454.     DEPTH        KV_FLOAT     P3           ROW          WHITE       
  455.     E1           KV_OPEN      P4           SGI          YELLOW      
  456.     E2           LIST_TYPE    P5           STRING_TYPE              
  457.  
  458. $
  459.  
  460. Language Description
  461.     The front end of the IRIT solid modeler is an infix parser that
  462.  mimics some of the C language behavior. The infix operators that are supported
  463.  are plus (+), minus (-), multiply (*), divide (/), and power (^), for
  464.  numeric operators, with the same precedence as in C.
  465.  
  466.     However, unlike the C language, these operators are overloaded,
  467.  or different action is taken, based upon the different operands.
  468.    This means that one can write '1 + 2', in which the plus sign denotes a
  469.  numeric addition, or one can write 'PolyObj1 + PolyObj2', in which case the
  470.  plus sign denotes the Boolean operation of a union between two geometric
  471.  objects.
  472.    The exact way each operator is overloaded is defined below.
  473.  
  474.    In this environment, reals, integers, and even Booleans, are all represented
  475.  as real types. Data are automatically promoted as necessary.
  476.    For example, the constants TRUE and FALSE are defined as 1.0 and 0.0
  477.  respectively.
  478.  
  479.    Each expression is terminated by a semicolon. An expression can be as
  480.  simple as 'a;' which prints the value of variable a, or as complex as:
  481.  
  482.     for ( t = 1.1, 0.1, 1.9,
  483.             cb1 = csurface( sb, COL, t ):
  484.             color( cb1, green ):
  485.             snoc( cb1, cb_all )
  486.         );
  487.  
  488.    While an expression is terminated with a semicolon, a colon is used to
  489.  terminate mini-expressions within an expression.
  490.  
  491.    Once a complete expression is read in (i.e., a semicolon is detected)
  492.  and parsed correctly (i.e. no syntax errors are found), it is executed.
  493.    Before each operator or a function is executed, parameter type matching
  494.  tests are made to make sure the operator can be applied to these
  495.  operand(s), or that the function gets the correct set of arguments.
  496.  
  497.    The parser is totally case insensitive, so Obj, obj, and OBJ will refer
  498.  to the same object, while MergePoly, MERGEPOLY, and mergePoly will refer
  499.  to the same function.
  500.  
  501.    Objects (Variables if you prefer) need not be declared. Simply use them
  502.  when you need them. Object names may be any alpha-numeric (and underscore)
  503.  string of at most 30 characters. By assigning to an old object, the old
  504.  object will be automatically deleted and if necessary its type will be
  505.  modified on the fly.
  506.  
  507.  Example:
  508.  
  509.     V = sin( 45 * pi / 180.0 );
  510.     V = V * vector( 1, 2, 3 );
  511.     V = V * rotx( 90 );
  512.     V = V * V;
  513.  
  514.  will assign to V a NumericType equal to the sine of 45 degrees, the VectorType
  515.  ( 1, 2, 3 ) scaled by the sine of 45, rotate that vector around the X axis
  516.  by 90 degrees, and finally a NumericType which is the dot (inner) product of
  517.  V with itself.
  518.  
  519.    The parser will read from stdin, unless a file is specified on the command
  520.  line or an INCLUDE command is executed. In both cases, when the end of file
  521.  is encountered, the parser will again wait for input from stdin. In order
  522.  to execute a file and quit in the end of the file, put an EXIT command as
  523.  the last command in the file.
  524. $
  525.  
  526. Overloading Plus
  527.  The + operator is overloaded above the following domains:
  528.  
  529.   NumericType + NumericType -> NumericType
  530.   VectorType  + VectorType  -> VectorType   (Vector addition)
  531.   MatrixType  + MatrixType  -> MatrixType   (Matrix addition)
  532.   PolygonType + PolygonType -> PolygonType  (Boolean UNION operation)
  533.   CurveType   + CurveType   -> CurveType    (Curve curve profiling)
  534.   CurveType   + CtlPtType   -> CurveType    (Curve control point profiling)
  535.   CtlPtType   + CtlPtType   -> CurveType    (Control points profiling)
  536.   ListType    + ListType    -> ListType     (Append lists operator)
  537.   StringType  + StringType  -> StringType   (String concat)
  538.   StringType  + RealType    -> StringType   (String concat, real as int string)
  539.  
  540.  Note: Boolean UNION of two disjoint objects (no common volume) will result
  541.  with the two objects combined. It is the USER responsibility to make sure that
  542.  the non intersecting objects are also disjoint - this system only tests for
  543.  no intersection.  Boolean UNION of two polyline objects will merge the list
  544.  of polylines.
  545. $
  546.  
  547. Overloading Minus
  548.  The - operator is overloaded above the following domains:
  549.  
  550.  As a binary operator:
  551.  
  552.   NumericType - NumericType -> NumericType
  553.   VectorType  - VectorType  -> VectorType   (Vectoric difference)
  554.   MatrixType  - MatrixType  -> MatrixType   (Matrix difference) 
  555.   PolygonType - PolygonType -> PolygonType  (Boolean SUBTRACT operation)
  556.  
  557.  As a unary operator:
  558.  
  559.   - NumericType -> NumericType
  560.   - VectorType  -> VectorType    (Scale vector by -1)
  561.   - MatrixType  -> MatrixType    (Scale matrix by -1)
  562.   - PolygonType -> PolygonType   (Boolean NEGATION operation)
  563.   - CurveType   -> CurveType     (Curve parameterization is reversed)
  564.   - SurfaceType -> SurfaceType   (Surface parameterization is reversed)
  565.  
  566.  Note: Boolean SUBTRACT of two disjoint objects (no common volume) will result
  567.  with an empty object. For both a curve and a surface parameterization, reverse
  568.  operation (binary minus) causes the object normal to be flipped as a side
  569.  effect.
  570. $
  571.  
  572. Overloading Astrisk
  573.  The * operator is overloaded above the following domains:
  574.  
  575.   NumericType  * NumericType   -> NumericType
  576.   VectorType   * NumericType   -> VectorType    (Vector scaling)
  577.   VectorType   * CurveType     -> CurveType     (Inner product projection)
  578.   VectorType   * SurfaceType   -> SurfaceType   (Inner product projection)
  579.   VectorType   * VectorType    -> NumericType   (Inner product)
  580.   MatrixType   * NumericType   -> MatrixType    (Matrix Scaling)
  581.   MatrixType   * PointType     -> PointType     (Point transformation)
  582.   MatrixType   * CtlPtType     -> CtlPtType     (Ctl Point transformation)
  583.   MatrixType   * VectorType    -> VectorType    (Vector transformation)
  584.   MatrixType   * MatrixType    -> MatrixType    (Matrix multiplication)
  585.   MatrixType   * GeometricType -> GeometricType (Object transformation)
  586.   MatrixType   * ListType      -> ListType      (Object hierarchy transform.)
  587.   PolygonType  * PolygonType   -> PolygonType   (Boolean INTERSECTION operation)
  588.   InstanceType * MatrixType    -> InstanceType  (Transform of Instance's matrix)
  589.  
  590.  Note: Boolean INTERSECTION of two disjoint objects (no common volume) will
  591.  result with an empty object. Object hierarchy transform transforms any
  592.  transformable object (GeometricType) found in the list recursively. Boolean
  593.  INTERSECTION of two planar (XY plane) polyline objects will compute the
  594.  intersection points of the two lists of polylines.
  595. $
  596.  
  597. Overloading Slash
  598.  The / operator is overloaded above the following domains:
  599.  
  600.   NumericType / NumericType -> NumericType
  601.   PolygonType / PolygonType -> PolygonType   (Boolean CUT operation)
  602.  
  603.  Note: Boolean CUT of two disjoint objects (no common volume) will result
  604.  with an empty object.
  605. $
  606.  
  607. Overloading Caret
  608.  The ^ operator is overloaded above the following domains:
  609.  
  610.   NumericType ^ NumericType -> NumericType
  611.   VectorType  ^ VectorType  -> VectorType  (Cross product)
  612.   MatrixType  ^ NumericType -> MatrixType  (Matrix to the (int) power)
  613.   PolygonType ^ PolygonType -> PolygonType (Boolean MERGE operation)
  614.   StringType  ^ StringType  -> StringType  (String concat)
  615.   StringType  ^ RealType    -> StringType  (String concat, real as real string)
  616.  
  617.  Note: Boolean MERGE simply merges the two sets of polygons without any
  618.  intersection tests. Matrix powers must be positive integers or -1, in which
  619.  case the matrix inverse (if it exists) is computed.
  620. $
  621.  
  622. Overloading Equal (Assignments)
  623.    Assignments are allowed as side effects, in any place in an expression.
  624.  If "Expr" is an expression, then "var = Expr" is the exact same expression
  625.  with the side effect of setting Var to that value. There is no guarantee
  626.  on the order of evaluation, so using Vars that are set within the same
  627.  expression is a bad practice. Use parentheses to force the order of
  628.  evaluation, i.e., "( var = Expr )".
  629. $
  630.  
  631. Comparison operators - ==, !=, <, >, <=, >=
  632.  The conditional comparison operators can be applied to the following
  633.  domains (o for a comparison operator):
  634.  
  635.   NumericType o NumericType -> NumericType
  636.   StringType  o StringType  -> NumericType
  637.   PointType   o PointType   -> NumericType
  638.   VectorType  o VectorType  -> NumericType
  639.   PlaneType   o PlaneType   -> NumericType
  640.  
  641.  The returned NumericType is non-zero if the condition holds, or zero if
  642.  not.
  643.    For PointTypes, VectorTypes, and PlaneTypes, only == and != comparisons
  644.  are valid. This is either the same or different.
  645.    For NumericTypes and StringTypes (uses strcmp) all comparisons are valid.
  646. $
  647.  
  648. Logical Operators - &&, ||, |
  649.  Complex logical expressions can be defined using the logical and (&&),
  650.  logical or (||) and logical not (!). These operators can be applied
  651.  to NumericTypes that are considered Boolean results. That is, true for a
  652.  non-zero value, and false otherwise.
  653.    The returned NumericType is true if both operands are true for the and
  654.  operator, at least one is true for the or operator, and the operand is
  655.  false for the not operator. In all other cases, a false is returned.
  656.    To make sure Logical expressions are readable, the and and or
  657.  operators are defined to have the same priority. Use parentheses to
  658.  disambiguate a logical expression and to make it more readable.
  659. $
  660.  
  661. Geometric Boolean Operations
  662.    The IRIT solid modeling system supports Boolean operations between
  663.  polyhedra objects. Freeform objects will be automaticaly converted to
  664.  a polygonal representation when used in Boolean operations.
  665.    The +, *, and - are overloaded to denote Boolean union, intersection
  666.  and subtraction when operating on geometric entities. - can also be
  667.  used as an unary operator to reverse the object orientation inside out.
  668.  
  669.  IRIT supports Boolean operations on polyhedra models.  A polyhedra
  670.  based model is simply a collection of polygons.  While a polyhedra is
  671.  simply a set of polygons, this set must conform to certain conditions:
  672.         Every polygon has known adjacent polygons, for all its edges.
  673.         Every polygon has a normal that points into the model.  That
  674.         normal is inside/outside consistent with its adjacent polygons.
  675.  In other words, for every polygon, one can locally determine the
  676.  inside or the outside of the model.  Moreover, every polygon has
  677.  neighbors for all its edges, forming a closed object that
  678.  consistently delineates inside from outside, globally.
  679.  
  680.  The Boolean operations are set operations conducted between two
  681.  such models, M_1 and M_2, that delineate inside from
  682.  outside.  Boolean Union, Boolean Intersection and Boolean Subtraction
  683.  are the three common operations that resemble the exact semantic that
  684.  is expected, when treating M_1 and M_2 as three
  685.  dimensional point sets.
  686.  
  687.  The Boolean operations can be formulated into a binary tree structure
  688.  also known as Constructive Solid Geometry (CSG) tree.
  689.  
  690.  
  691.    Example:
  692.  
  693.     resolution = 20;
  694.     B = box(vector(-1, -1, -0.25), 2, 1.2, 0.5);
  695.     C = con2(vector(0, 0, -1.5), vector(0, 0, 3), 0.7, 0.3);
  696.  
  697.     D = convex(B - C);
  698.     E = convex(C - B);
  699.     F = convex(B + C);
  700.     G = convex(B * C);
  701.  
  702.     tr = rotx( -90 ) * roty( 40 ) * rotx( -30 );
  703.  
  704.     All = list( D * tr * trans( vector(  0.6,  0.5, 0.0 ) ),
  705.                 E * tr * trans( vector(  3.0,  0.0, 0.0 ) ),
  706.                 F * tr * trans( vector( -2.0,  0.0, 0.0 ) ),
  707.                 G * tr * trans( vector(  0.7, -1.0, 0.0 ) ) )
  708.             * scale( vector( 0.25, 0.25, 0.25 ) )
  709.             * trans( vector( -0.1, -0.3, 0.0 ) );
  710.     view_mat = rotx( 0 );
  711.     view( list( view_mat, All ), on );
  712.     save( "booleans", list( view_mat, All ) );
  713.  
  714.     A complete example to compute the union, intersection and both
  715.  differences of a box and a truncated cone.
  716.  
  717.  Special cases can be very difficult to handle when considering Boolean
  718.  operations.  Consider an axes parallel bounding cube.  Consider a
  719.  second cube rotated alpha degrees from the first cube.  At large
  720.  angles, the Boolean operations are fairly simple to
  721.  compute. Nevertheless, as alpha approaches zero, the almost coplanar
  722.  planes of the two intersecting cubes make it very difficult to
  723.  robustly and consistently compute their intersection.
  724.  
  725.     There are several flags to control the Boolean operations. See
  726.  IRITSTATE command for the "InterCrv", "Coplanar", and "PolySort"
  727.  states.
  728. $
  729.  
  730. Priority of operators
  731.    The following table lists the priority of the different operators.
  732.  
  733.     Lowest             Operator           Name of operator  
  734.     priority           ,                  comma             
  735.                        :                  colon             
  736.                        &&, ||             logical and, logical or
  737.                        =,==,!=,<=,>=,<,>  assignment, equal, not equal, less
  738.                                           equal, greater equal, less, greater
  739.                        +, -               plus, minus       
  740.                        *, /               multiply, divide  
  741.     Highest            ^                  power             
  742.     priority           -, !               unary minus, logical not
  743.  
  744.  
  745.    The grammar of the IRIT parser follows similar guidelines as
  746.  the C language for simple expressions. However, complex statements differ.
  747.    See the IF, FOR, FUNCTION, and PROCEDURE below for the usage of these
  748.  clauses.
  749.  
  750. $
  751.  
  752. Function Description
  753. $
  754.  
  755. NumericType returning functions
  756. $
  757.  
  758. ABS
  759.  
  760.  NumericType ABS( NumericType Operand )
  761.  
  762.    Returns the absolute value of the given Operand.
  763. $
  764.  
  765. ACOS
  766.  
  767.  NumericType ACOS( NumericType Operand )
  768.  
  769.    Returns the arc cosine value (in radians) of the given Operand.
  770. $
  771.  
  772. AREA
  773.  
  774.  NumericType AREA( PolygonType Object )
  775.  
  776.    Returns the area of the given Object (in object units). Returned is
  777.  the area of the polygonal object, not the area of the primitive it might
  778.  approximate.
  779.  
  780.    This means that the area of a polygonal approximation of a sphere will be
  781.  returned, not the exact area of the sphere.
  782. $
  783.  
  784. ASIN
  785.  
  786.  NumericType ASIN( NumericType Operand )
  787.  
  788.    Returns the arc sine value (in radians) of the given Operand.
  789. $
  790.  
  791. ATAN
  792.  
  793.  NumericType ATAN( NumericType Operand )
  794.  
  795.    Returns the arc tangent value (in radians) of the given Operand.
  796. $
  797.  
  798. ATAN2
  799.  
  800.  NumericType ATAN2( NumericType Operand1, NumericType Operand2 )
  801.  
  802.    Returns the arc tangent value (in radians) of the given ratio:
  803.  Operand1 / Operand2, over the whole circle.
  804. $
  805.  
  806. COS
  807.  
  808.  NumericType COS( NumericType Operand )
  809.  
  810.    Returns the cosine value of the given Operand (in radians).
  811. $
  812.  
  813. CLNTEXEC
  814.  
  815.  NumericType CLNTEXEC( StringType ClientName )
  816.  
  817.    Initiate communication channels to a client named ClientName.
  818.  ClientName is executed by this function as a sub process and
  819.  two communication channels are opened between the IRIT server and the
  820.  new client, for read and write. See also CLNTREAD, CLNTWRITE, and
  821.  CLNTCLOSE. if ClientName is an empty string, the user is provided
  822.  with the new communication port to be used and the server blocks for the
  823.  user to manualy executed the client after setting the proper
  824.  IRIT_SERVER_HOST/PORT environment variables.
  825.  
  826.  Example:
  827.  
  828.    h1 = CLNTEXEC( "" );
  829.    h2 = CLNTEXEC( "nuldrvs -s-" );
  830.  
  831.  executes two clients, one is named nuldrvs and the other one is
  832.  prompted for by the user. As a result of the second invokation of
  833.  CLNTEXEC, the user will be prompted with a message similar to,
  834.  
  835.     Irit: Startup your program - I am waiting...
  836.  
  837.     setenv IRIT_SERVER_PORT 2182
  838.  
  839.  and he/she will need to set the proper environment variable and execute
  840.  their client manually.
  841. $
  842.  
  843. CPOLY
  844.  
  845.  NumericType CPOLY( PolygonType Object )
  846.  
  847.    Returns the number of polygons in the given polygonal Object.
  848. $
  849.  
  850. DSTPTLN
  851.  
  852.  NumericType DSTPTLN( PointType Pt, PointType LineOrig, VectorType LineRay )
  853.  
  854.    Returns the distance between a given point Pt and line
  855.  LineOrig, LineRay. See also PTPTLN.
  856. $
  857.  
  858. DSTPTPLN
  859.  
  860.  NumericType DSTPTPLN( PointType Pt, PlaneType Plane )
  861.  
  862.    Returns the distance between a given point Pt and plane
  863.  Plane.
  864. $
  865.  
  866. DSTLNLN
  867.  
  868.  NumericType DSTLNLN( PointType Line1Orig, VectorType Line1Ray,
  869.                       PointType Line2Orig, VectorType Line2Ray )
  870.  
  871.    Returns the distance between two lines defined by point LineiOrig
  872.  and ray LineiRay. See also PTSLNLN.
  873. $
  874.  
  875. EXP
  876.  
  877.  NumericType EXP( NumericType Operand )
  878.  
  879.    Returns the natural exponent value of the given Operand.
  880. $
  881.  
  882. FLOOR
  883.  
  884.  NumericType FLOOR( NumericType Operand )
  885.  
  886.    Returns the largest integer not greater than Operand.
  887. $
  888.  
  889. FMOD
  890.  
  891.  NumericType FMOD( NumericType Operand, NumericType Mod )
  892.  
  893.    Returns the floating point remainder of the division of Operand by
  894.  Mod.
  895. $
  896.  
  897. LN
  898.  
  899.  NumericType LN( NumericType Operand )
  900.  
  901.    Returns the natural logarithm value of the given Operand.
  902. $
  903.  
  904. LOG
  905.  
  906.  NumericType LOG( NumericType Operand )
  907.  
  908.    Returns the base 10 logarithm value of the given Operand.
  909. $
  910.  
  911. MESHSIZE
  912.  
  913.  NumericType MESHSIZE( SurfaceType Srf, ConstantType Direction )
  914.  
  915.    Returns the size of Srf's mesh in Direction, which
  916.  is one of COL or ROW.
  917.  
  918.  Example:
  919.  
  920.    RSize = MESHSIZE( Sphere, ROW );
  921.    CSize = MESHSIZE( Sphere, COL );
  922. $
  923.  
  924. POWER
  925.  
  926.  NumericType POWER( NumericType Operand, NumericType Exp )
  927.  
  928.    Returns Operand to the power of Exp.
  929. $
  930.  
  931. RANDOM
  932.  
  933.  NumericType RANDOM( NumericType Min, NumericType Max )
  934.  
  935.    Returns a randomized value between Min and Max.
  936. $
  937.  
  938. SIN
  939.  
  940.  NumericType SIN( NumericType Operand )
  941.  
  942.    Returns the sine value of the given Operand (in radians).
  943. $
  944.  
  945. SIZEOF
  946.  
  947.  NumericType SIZEOF( ListType List | PolygonType Poly |
  948.                      CurveType Crv | StringType Str )
  949.  
  950.    Returns the length of a list if List, the number of polygons
  951.  if Poly, the length of the control polygon if Crv, or the
  952.  number of characters in string if Str.
  953.    If, however, only one polygon is in Poly, it returns the number
  954.  of vertices in that polygon.
  955.  
  956.  Example:
  957.  
  958.    len = SIZEOF( list( 1, 2, 3 ) );
  959.    numPolys = SIZEOF( axes );
  960.    numCtlpt = SIZEOF( circle( vector( 0, 0, 0 ), 1 ) );
  961.  
  962.  will assign the value of 3 to the variable len, set numPolys
  963.  to the number of polylines in the axes object, and set numCtlPt to 9, the
  964.  number of control points in a circle.
  965. $
  966.  
  967. SQRT
  968.  
  969.  NumericType SQRT( NumericType Operand )
  970.  
  971.    Returns the square root value of the given Operand.
  972. $
  973.  
  974. TAN
  975.  
  976.  NumericType TAN( NumericType Operand )
  977.  
  978.    Returns the tangent value of the given Operand (in radians).
  979. $
  980.  
  981. THISOBJ
  982.  
  983.  NumericType THISOBJ( StringType Object )
  984.  
  985.    Returns the object type of the given name of an Object. This can
  986.  be one of the constants,
  987.  
  988.     UNDEF_TYPE        VECTOR_TYPE       MATRIX_TYPE       SURFACE_TYPE     
  989.     NUMERIC_TYPE      POINT_TYPE        POLY_TYPE         TRIMSRF_TYPE     
  990.     STRING_TYPE       CTLPT_TYPE        CURVE_TYPE        TRIVAR_TYPE      
  991.  
  992.    This is also a way to ask if an object by a given name do exist (if the
  993.  returned type is UNDEF_TYPE or not).
  994. $
  995.  
  996. VOLUME
  997.  
  998.  NumericType VOLUME( PolygonType Object )
  999.  
  1000.    Returns the volume of the given Object (in object units). It returns
  1001.  the volume of the polygonal object, not the volume of the object it might
  1002.  approximate.
  1003.  
  1004.    This routine decomposes all non-convex polygons to convex ones as a side
  1005.  effect (see CONVEX).
  1006. $
  1007.  
  1008. GeometricType returning functions
  1009. $
  1010.  
  1011. ADAPISO
  1012.  
  1013.  CurveType ADAPISO( SurfaceType Srf, NumericType Dir, NumericType Eps,
  1014.                     NumericType FullIso, NumericType SinglePath )
  1015.  
  1016.  Constructs a coverage to Srf using isocurve in the Dir direction,
  1017.  so that for any point p on surface Srf, there exists a point on one of
  1018.  the isocurves that is close to p within Eps. If FullIso, the
  1019.  extracted isocurves span the entire surface domain, otherwise they may
  1020.  span only a subset of the domain. If SinglePath, an approximation to
  1021.  a single path (Hamiltonian path) that visits all isocurves is constructed
  1022.  (not supported). See also COVERPT, COVERISO.
  1023.  
  1024.     srf = sbezier( list( list( ctlpt( E3, -0.5, -1.0,  0.0 ),
  1025.                                ctlpt( E3,  0.4,  0.0,  0.1 ),
  1026.                                ctlpt( E3, -0.5,  1.0,  0.0 ) ),
  1027.                          list( ctlpt( E3,  0.0, -0.7,  0.1 ),
  1028.                                ctlpt( E3,  0.0,  0.0,  0.0 ),
  1029.                                ctlpt( E3,  0.0,  0.7, -0.2 ) ),
  1030.                          list( ctlpt( E3,  0.5, -1.0,  0.1 ),
  1031.                                ctlpt( E3, -0.4,  0.0,  0.0 ),
  1032.                                ctlpt( E3,  0.5,  1.0, -0.2 ) ) ) );
  1033.     aiso = ADAPISO( srf, COL, 0.1, FALSE, FALSE );
  1034.  
  1035.  Constructs an adaptive isocurve approximation with tolerance of 0.1 to
  1036.  surface srf in direction COL. Isocurves are allowed to span a
  1037.  subset of the surface domain. No single path is needed.
  1038.  
  1039.  The SinglePath option is currently not supported.
  1040. $
  1041.  
  1042. ARC
  1043.  
  1044.  CurveType ARC( VectorType StartPos, VectorType Center, VectorType EndPos )
  1045.  
  1046.  Constructs an arc between the two end points StartPos and EndPos,
  1047.  centered at Center. Arc will always be less than 180 degrees, so the
  1048.  shortest circular path from StartPos to EndPos is selected. The
  1049.  case where StartPos, Center, and EndPos are collinear is
  1050.  illegal, since it attempts to define a 180 degrees arc. Arc is constructed
  1051.  as a single rational quadratic Bezier curve.
  1052.  
  1053.  Example:
  1054.  
  1055.     Arc1 = ARC( vector( 1.0, 0.0, 0.0 ),
  1056.                 vector( 1.0, 1.0, 0.0 ),
  1057.                 vector( 0.0, 1.0, 0.0 ) );
  1058.  
  1059.  constructs a 90 degrees arc, tangent to both the X and Y axes at coordinate 1.
  1060. $
  1061.  
  1062. AOFFSET
  1063.  
  1064.  CurveType AOFFSET( CurveType Crv, NumericType OffsetDistance,
  1065.                     NumericType Epsilon, NumericType TrimLoops,
  1066.                     NumericType BezInterp )
  1067.  
  1068.  Computes an offset of OffsetDistance with globally bounded error
  1069.  (controlled by Epsilon). The smaller Epsilon is, the better
  1070.  the approximation to the offset. The bounded error is achieved by adaptive
  1071.  refinement of the Crv.
  1072.    If TrimLoops is TRUE or on, the regions of the object that
  1073.  self-intersect as a result of the offset operation are trimmed away.
  1074.    If BezInterp is TRUE, each curve's segment is interpolated instead
  1075.  of approximated.
  1076.  
  1077.  Example:
  1078.  
  1079.     OffCrv1 = AOFFSET( Crv, 0.5, 0.01, FALSE, FALSE );
  1080.     OffCrv2 = AOFFSET( Crv, 0.5, 0.01, TRUE, FALSE );
  1081.  
  1082.  computes an adaptive offset to Crv with OffsetDistance of
  1083.  0.5 and Epsilon of 0.01 and trims the self-intersection loops in
  1084.  the second instrance.
  1085.  See also OFFSET, LOFFSET, and MOFFSET.
  1086. $
  1087.  
  1088. BBOX
  1089.  
  1090.  ListType BBOX( GeometricTreeType Geom )
  1091.  
  1092.  Given a (tree of ) geometry, Geom computes its bounding box and
  1093.  return it as a list of six numbers: XMin/Max, YMin/Max, ZMin/Max, in this
  1094.  order.
  1095.  
  1096.  Example:
  1097.  
  1098.  B1 = BBOX( axes );
  1099. $
  1100.  
  1101. BOOLONE
  1102.  
  1103.  SurfaceType BOOLONE( CurveType Crv )
  1104.  
  1105.  Given a closed curve, the curve is subdivided into four segments equally
  1106.  spaced in the parametric space that are fed into BOOLSUM. Useful if
  1107.  a surface should "fill" the area enclosed by a closed curve.
  1108.  
  1109.  Example:
  1110.  
  1111.  Srf = BOOLONE( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );
  1112.  
  1113.  Creates a disk surface containing the area enclosed by the unit circle.
  1114. $
  1115.  
  1116. BOOLSUM
  1117.  
  1118.  SurfaceType BOOLSUM( CurveType Crv1, CurveType Crv2,
  1119.                       CurveType Crv3, CurveType Crv4 )
  1120.  
  1121.  Construct a surface using the provided four curves as its four boundary
  1122.  curves. Curves do not have to have the same order or type, and will be
  1123.  promoted to their least common denominator. The end points of the four
  1124.  curves should match as follows:
  1125.  
  1126.     Crv1 start point,              to Crv3 start point.        
  1127.     Crv1 end point,                to Crv4 start point.        
  1128.     Crv2 start point,              to Crv3 end point.          
  1129.     Crv2 end point,                to Crv4 end point.          
  1130.  
  1131.  where Crv1 and Crv2 are the two boundaries in one parametric
  1132.  direction, and Crv3 and Crv4 are the two boundaries in the other
  1133.  parametric direction.
  1134.  
  1135.  Example:
  1136.  
  1137.     Cbzr1 = cbezier( list( ctlpt( E3, 0.1, 0.1, 0.1 ),
  1138.                            ctlpt( E3, 0.0, 0.5, 1.0 ),
  1139.                            ctlpt( E3, 0.4, 1.0, 0.4 ) ) );
  1140.     Cbzr2 = cbezier( list( ctlpt( E3, 1.0, 0.2, 0.2 ),
  1141.                            ctlpt( E3, 1.0, 0.5, -1.0 ),
  1142.                            ctlpt( E3, 1.0, 1.0, 0.3 ) ) );
  1143.     Cbsp3 = cbspline( 4,
  1144.                       list( ctlpt( E3, 0.1,  0.1, 0.1 ),
  1145.                             ctlpt( E3, 0.25, 0.0, -1.0 ),
  1146.                             ctlpt( E3, 0.5,  0.0, 2.0 ),
  1147.                             ctlpt( E3, 0.75, 0.0, -1.0 ),
  1148.                             ctlpt( E3, 1.0,  0.2, 0.2 ) ),
  1149.                       list( KV_OPEN ) );
  1150.     Cbsp4 = cbspline( 4,
  1151.                       list( ctlpt( E3, 0.4,  1.0, 0.4 ),
  1152.                             ctlpt( E3, 0.25, 1.0, 1.0 ),
  1153.                             ctlpt( E3, 0.5,  1.0, -2.0 ),
  1154.                             ctlpt( E3, 0.75, 1.0, 1.0 ),
  1155.                             ctlpt( E3, 1.0,  1.0, 0.3 ) ),
  1156.                       list( KV_OPEN ) );
  1157.     Srf = BOOLSUM( Cbzr1, Cbzr2, Cbsp3, Cbsp4 );
  1158. $
  1159.  
  1160. BOX
  1161.  
  1162.  PolygonType BOX( VectorType Point,
  1163.                   NumericType Dx, NumericType Dy, NumericType Dz )
  1164.  
  1165.    Creates a BOX polygonal object, whose boundary is coplanar with the
  1166.  XY, XZ, and YZ planes. The BOX is defined by Point as
  1167.  base position, and Dx, Dy, Dz as BOX dimensions. Negative dimensions
  1168.  are allowed.
  1169.  
  1170.  Example:
  1171.  
  1172.     B = BOX( vector( 0, 0, 0 ), 1, 1, 1);
  1173.  
  1174.  creates a unit cube from 0 to 1 in all axes.
  1175. $
  1176.  
  1177. BZR2BSP
  1178.  
  1179.  CurveType BZR2BSP( CurveType Crv )
  1180.  
  1181.  or
  1182.  
  1183.  SurfaceType BZR2BSP( SurfaceType Srf )
  1184.  
  1185.    Creates a Bspline curve or a Bspline surface from the given Bezier curve or
  1186.  Bezier surface. The Bspline curve or surface is assigned open end knot
  1187.  vector(s) with no interior knots, in the parametric domain of zero to one.
  1188.  
  1189.  Example:
  1190.  
  1191.     BspSrf = BZR2BSP( BzrSrf );
  1192. $
  1193.  
  1194. BSP2BZR
  1195.  
  1196.  CurveType | ListType BSP2BZR( CurveType Crv )
  1197.  
  1198.  or
  1199.  
  1200.  SurfaceType | ListType BSP2BZR( SurfaceType Srf )
  1201.  
  1202.    Creates Bezier curve(s) or surface(s) from a given Bspline curve or a
  1203.  Bspline surface. The Bspline input is subdivided at all internal knots to
  1204.  create Bezier curves or surfaces. Therefore, if the input Bspline does have
  1205.  internal knots, a list of Bezier curves or surfaces is returned. Otherwise,
  1206.  a single Bezier curve or surface is returned.
  1207.  
  1208.  Example:
  1209.  
  1210.     BzrCirc = BSP2BZR( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );
  1211.  
  1212.  would subdivide the unit circle into four 90 degrees Bezier arcs returned
  1213.  in a list.
  1214. $
  1215.  
  1216. CBEZIER
  1217.  
  1218.  CurveType CBEZIER( ListType CtlPtList )
  1219.  
  1220.    Creates a Bezier curve out of the provided control point list. CtlPtList
  1221.  is a list of control points, all of which must be of type (E1-E5, P1-P5),
  1222.  or regular PointType defining the curve's control polygon. Curve's point type
  1223.  will be of a space which is the union of the spaces of all points.
  1224.  
  1225.  Example:
  1226.  
  1227.     s45 = sin(pi / 4);
  1228.     Arc90 = CBEZIER( list( ctlpt( P2, 1.0, 0.0, 1.0 ),
  1229.                            ctlpt( P2, s45, s45, s45 ),
  1230.                            ctlpt( P1, 1.0, 1.0 ) ) );
  1231.  
  1232.  constructs an arc of 90 degrees as a rational quadratic Bezier curve.
  1233. $
  1234.  
  1235. CBISECTOR
  1236.  
  1237.  { CurveType | SurfaceType } CBISECTOR( CurveType Crv,
  1238.                                         NumericType UseNrmlTan,
  1239.                                         NumericType Tolerance,
  1240.                                         NumericType NumerImprove,
  1241.                                         NumericType SameNormal )
  1242.  
  1243.  or
  1244.  
  1245.  { CurveType | SurfaceType } CBISECTOR( ListType TwoCrvs,
  1246.                                         NumericType UseNrmlTan,
  1247.                                         NumericType Tolerance,
  1248.                                         NumericType NumerImprove,
  1249.                                         NumericType SameNormal )
  1250.  
  1251.  or
  1252.  
  1253.  SurfaceType CBISECTOR( ListType CrvPt,
  1254.                         NumericType UseNrmlTan,
  1255.                         NumericType Tolerance,
  1256.                         NumericType NumerImprove,
  1257.                         NumericType SameNormal )
  1258.  
  1259.     Computes the self bisector curve(s) for Crv or the bisector(s)
  1260.  of TwoCrvs or the bisector of a curve and a point, CrvPt. If
  1261.  UseNrmlTan is equal to zero or one, the bisector curves are computed
  1262.  using angular equality of tangents or normals of the given curve or curves,
  1263.  respectively. Tolerance controls the accuracy of the computation,
  1264.  with 10 as a good starting value. If Tolerance is negative,
  1265.  NumerImprove can be either TRUE or FALSE, allowing or disabling a
  1266.  final numerical imrpovement stage.  SameNormal can also assume a
  1267.  TRUE or FALSE value, selecting only opposite facing normals, if TRUE.
  1268.  
  1269.     Nevertheless, if UseNrmlTan equals -1, the bisector surface of
  1270.  the given two curves TwoCrvs or a curve and a point CrvPt is
  1271.  computed analytically.  For two 3-space curves this is indeed the bisector
  1272.  surface while for two 2-space curves, the zero set of the returned surface
  1273.  provides the bisector curve.  If UseNrmlTan equals -1, then
  1274.  Tolerance, NumerImprove, and SameNormal are all ignored.
  1275.  
  1276.     If UseNrmlTan equals -2 and the two curves are E2, a different
  1277.  bisector surface is computed whose zero set provides the bisector curve.
  1278.  If UseNrmlTan equals -2, then Tolerance, NumerImprove,
  1279.  and SameNormal are all ignored.
  1280.  
  1281.     If UseNrmlTan equals -3 and the two curves are 3-space curves,
  1282.  an alpha bisector surface is computed, whose ratio is set via Tolerance
  1283.  relative to NumerImprove, such that the sum of Tolerance +
  1284.  NumerImprove is not zero. If UseNrmlTan equals -3, then
  1285.  SameNormal is ignored. See also SBISECTOR.
  1286.  
  1287.  Example:
  1288.  
  1289.     c1 = cbezier( list( ctlpt( E2, -0.5, -0.2 ),
  1290.                         ctlpt( E2,  0.0, -0.2 ),
  1291.                         ctlpt( E2,  0.6,  0.6 ) ) );
  1292.     c2 = cbezier( list( ctlpt( E2,  0.3, -0.7 ),
  1293.                         ctlpt( E2, -0.2, -0.7 ),
  1294.                         ctlpt( E2,  0.7,  0.6 ) ) );
  1295.     BisectCrvs = CBISECTOR( list( c1, c2 ), 0, 12, true, false );
  1296.     All = list( c1, c2, BisectCrvs );
  1297.     interact( list( All, view_mat2d ) );
  1298.     
  1299.     c1 = creparam( pcircle( vector( 0.0, 0.0, 0.0 ), 1 ), 0, 1 );
  1300.     c2 = cbezier( list( ctlpt( E3, -1.0, 0.0,  1.0 ),
  1301.                         ctlpt( E3,  1.0, 0.0, -1.0 ) ) );
  1302.     
  1303.     BisectSrf = CBISECTOR( list( c1, c2 ), -1, -1, true, false );
  1304.     interact( list( c1, c2, BisectSrf ) );
  1305.  
  1306.  computes two bisectors, one for to planar curves as a set of bisector curves,
  1307.  and the other as a bisector surfce of a Z parallel line and a circle in the
  1308.  XY plane.
  1309. $
  1310.  
  1311. CBSPLINE
  1312.  
  1313.  CurveType CBSPLINE( NumericType Order, ListType CtlPtList,
  1314.                                                         ListType KnotVector )
  1315.  
  1316.    Creates a Bspline curve out of the provided control point list, the
  1317.  knot vector, and the specified order. CtlPtList is a list of control
  1318.  points, all of which must be of type (E1-E5, P1-P5), or regular PointType
  1319.  defining the curve's control polygon. Curve's point type will be of a space
  1320.  which is the union of the spaces of all points.
  1321.    The length of the KnotVector must be equal to the number of control
  1322.  points in CtlPtList plus the Order. If, however, the length of
  1323.  the knot vector is equal to #CtlPtList + Order + Order - 1 the curve
  1324.  is assumed periodic.
  1325.    The knot vector list may be specified as either list( KV_OPEN ) or
  1326.  list( KV_FLOAT ) or list( KV_PERIODIC ) in which a uniform
  1327.  open, uniform floating or uniform periodic knot vector with the appropriate
  1328.  length is automatically constructed. 
  1329.  
  1330.  Example:
  1331.  
  1332.     s45 = sin(pi / 4);
  1333.     HalfCirc = CBSPLINE( 3,
  1334.                          list( ctlpt( P3,  1.0,  1.0,  0.0, 0.0 ),
  1335.                                ctlpt( P3,  s45,  s45,  s45, 0.0 ),
  1336.                                ctlpt( P3,  1.0,  0.0,  1.0, 0.0 ),
  1337.                                ctlpt( P3,  s45, -s45,  s45, 0.0 ),
  1338.                                ctlpt( P3,  1.0, -1.0,  0.0, 0.0 ) ),
  1339.                          list( 0, 0, 0, 1, 1, 2, 2, 2 ) );
  1340.  
  1341.  constructs an arc of 180 degrees in the XZ plane as a rational quadratic
  1342.  Bspline curve.
  1343.  
  1344.  Example:
  1345.  
  1346.     c = CBSPLINE( 4,
  1347.                   list( ctlpt( E2,  0.5,  0.5 ),
  1348.                         ctlpt( E2, -0.5,  0.5 ),
  1349.                         ctlpt( E2, -0.5, -0.5 ),
  1350.                         ctlpt( E2,  0.5, -0.5 ) ),
  1351.                   list( KV_PERIODIC ) );
  1352.     color( c, red );
  1353.     viewobj( c );
  1354.     
  1355.     c1 = cregion( c, 3, 4 );
  1356.     color( c1, green );
  1357.     c2 = cregion( c, 4, 5 );
  1358.     color( c2, yellow );
  1359.     c3 = cregion( c, 5, 6 );
  1360.     color( c3, cyan );
  1361.     c4 = cregion( c, 6, 7 );
  1362.     color( c3, magenta );
  1363.     viewobj( list( c1, c2, c3, c4 ) );
  1364.  
  1365.  creates a periodic curve and extracts its four polynomial domains as four
  1366.  open end Bspline curves.
  1367. $
  1368.  
  1369. CCINTER
  1370.  
  1371.  ListType CCINTER( CurveType Crv1, CurveType Crv2, NumericType Epsilon,
  1372.                                                        NumericType SelfInter )
  1373.  
  1374.  or
  1375.  
  1376.  SurfaceType CCINTER( CurveType Crv1, CurveType Crv2, NumericType Epsilon,
  1377.                                                        NumericType SelfInter )
  1378.  
  1379.    Computes the intersection point(s) of Crv1 and Crv2 in the
  1380.  XY plane. Since this computation involves numeric operations, Epsilon
  1381.  controls the accuracy of the parametric values of the result.
  1382.    It returns a list of PointTypes, each containing the parameter of Crv1
  1383.  in the X coordinate, and the parameter of Crv2 in the Y coordinate.
  1384.    If, however, Epsilon is negative, a scalar field surface representing
  1385.  the square of the distance function is returned instead.
  1386.    If SelfInter is TRUE, Crv1 and Crv2 can be the same
  1387.  curve, and self-intersection points are searched instead.
  1388.  
  1389.  Example:
  1390.  
  1391.  crv1 = cbspline( 3,
  1392.                   list( ctlpt( E2, 0, 0 ),
  1393.                         ctlpt( E2, 0, 0.5 ),
  1394.                         ctlpt( E2, 0.5, 0.7 ),
  1395.                         ctlpt( E2, 1, 1 ) ),
  1396.                   list( KV_OPEN ) );
  1397.  crv2 = cbspline( 3,
  1398.                   list( ctlpt( E2, 1, 0 ),
  1399.                         ctlpt( E2, 0.7, 0.25 ),
  1400.                         ctlpt( E2, 0.3, 0.5 ),
  1401.                         ctlpt( E2, 0, 1 ) ),
  1402.                   list( KV_OPEN ) );
  1403.  inter_pts = CCINTER( crv1, crv2, 0.0001, FALSE );
  1404.  
  1405.  Computes the parameter values of the intersection point of crv1 and
  1406.  crv2 to a tolerance of 0.0001.
  1407. $
  1408.  
  1409. CCRVTR
  1410.  
  1411.  NumericType CCRVTR( CurveType Crv, NumericType Epsilon )
  1412.  
  1413.  or
  1414.  
  1415.  CurveType CCRVTR( CurveType Crv, NumericType Epsilon )
  1416.  
  1417.    Computes the extreme curvature points on Crv in the XY plane.
  1418.  This set includes not only points of maximum (convexity) and mimumum
  1419.  (concavity) curvature, but also points of zero curvature such as
  1420.  inflection points.
  1421.    Since this operation is partially numeric, Epsilon is used to set
  1422.  the needed accuracy. It returns the parameter value(s) of the location(s)
  1423.  with extreme curvature along the Crv.
  1424.    If, however, Epsilon is negative, the curvature scalar field
  1425.  curve is returned as a two dimensional rational vector field curve, for
  1426.  which the first dimension is equal to the parameter, and the second is the
  1427.  curvature value at that parameter.
  1428.  
  1429.    This function computes the curvature scalar field for planar curves as,
  1430.  
  1431.           x' y'' - x'' y' 
  1432.    k(t) = ----------------
  1433.                2     2  3/2
  1434.            ( x'  + y'  )
  1435.  
  1436.  and computes kN for three dimensional curves as the following vector field,
  1437.  
  1438.                                   C' x C''     C'    (C' x C'') x C'
  1439.    k(t) N(t) = K(t) B(t) x T(t) = -------- x ----- = ---------------
  1440.                                         3    | C' |            4
  1441.                                    | C'|                 | C' |
  1442.  
  1443.  The extremum values are extracted from the computed curvature field.
  1444.  This curvature field is a high order curve, even if the input geometry is
  1445.  of low order. This is especially true for rational curves, for which the
  1446.  quotient rule for differentiation is used and almost doubles the degree
  1447.  in every differentiation.
  1448.  
  1449.  See also CZEROS, CEXTREMES, and SCRVTR.
  1450.  
  1451.  Example:
  1452.  
  1453.  crv = cbezier( list( ctlpt( E2, -1.0,  0.5 ),
  1454.                       ctlpt( E2, -0.5, -2.0 ),
  1455.                       ctlpt( E2,  0.0,  1.0 ),
  1456.                       ctlpt( E2,  1.0,  0.0 ) ) ) * rotz( 30 );
  1457.  crvtr = CCRVTR( crv, 0.001 );
  1458.  pt_crvtr = nil();
  1459.  pt = nil();
  1460.  for ( i = 1, 1, sizeof( crvtr ),
  1461.      ( pt = ceval( crv, nth( crvtr, i ) ) ):
  1462.      snoc( pt, pt_crvtr )
  1463.  );
  1464.  interact( list( crv, pt_crvtr ) );
  1465.  
  1466.  finds the extreme curvature points in Crv and displays them all
  1467.  with the curve.
  1468. $
  1469.  
  1470. CDERIVE
  1471.  
  1472.  CurveType CDERIVE( CurveType Curve )
  1473.  
  1474.    Returns a vector field curve representing the differentiated curve,
  1475.  also known as the Hodograph curve.
  1476.  
  1477.  Example:
  1478.  
  1479.  Circ = circle( vector( 0.0, 0.0, 0.0 ), 1.0 );
  1480.  Hodograph = CDERIVE( Circ );
  1481. $
  1482.  
  1483. CDIVIDE
  1484.  
  1485.  ListType CDIVIDE( CurveType Curve, NumericType Param )
  1486.  
  1487.    Subdivides a curve into two sub-curves at the specified parameter value.
  1488.  Curve can be either a Bspline curve in which Param must be
  1489.  within the Curve's parametric domain, or a Bezier curve in which Param
  1490.  can be arbitrary, extrapolating if not in the range of zero to one.
  1491.  
  1492.    Returns a list of the two sub-curves. The individual curves may be
  1493.  extracted from the list using the NTH command.
  1494.  
  1495.  Example:
  1496.  
  1497.  CrvLst = CDIVIDE( Crv, 1.3 );
  1498.  Crv1 = nth( CrvLst, 1 );
  1499.  Crv2 = nth( CrvLst, 2 );
  1500.  
  1501.  subdivides the curve Crv at the parameter value of 0.5.
  1502. $
  1503.  
  1504. CEDITPT
  1505.  
  1506.  CurveType CEDITPT( CurveType Curve, CtlPtType CtlPt, NumericType Index )
  1507.  
  1508.    Provides a simple mechanism to manually modify a single control point number
  1509.  Index (base count is 0) in Curve, by substituting CtlPt
  1510.  instead. CtlPt must have the same point type as the control points of
  1511.  the  Curve. Original curve Curve is not modified.
  1512.  
  1513.  Example:
  1514.  
  1515.     CPt = ctlpt( E3, 1, 2, 3 );
  1516.     NewCrv = CEDITPT( Curve, CPt, 1 );
  1517.  
  1518.  constructs a NewCrv with the second control point of Curve being
  1519.  CPt.
  1520. $
  1521.  
  1522. CENVOFF
  1523.  
  1524.  SurfaceType CENVOFF( CurveType Curve,
  1525.                       NumericType Height, NumericType Tolerance )
  1526.  
  1527.  or
  1528.  
  1529.  ListType CENVOFF( CurveType Curve, NumericType Height, NumericType Tolerance )
  1530.  
  1531.    Computes the offset envelope of a given planar curve Curve.  The
  1532.  offset envelope is the envelope of cones with apex on point on Curve
  1533.  in the Z direction. Height is the height of the cone which also
  1534.  equals the offset distance or the width of the cones.  Tolerance
  1535.  controls the accuracy of the offset approximation.
  1536.  
  1537.    If Curve is closed, two surfaces are created in the offset envelope,
  1538.  one for the inside and one for the outside.  If Curve is open, a single
  1539.  envelope offset surface is computed wrapping around both sides.
  1540.  
  1541.  Example:
  1542.  
  1543.  
  1544.     c1 = cbezier( list( ctlpt( E2, -0.8, 0.0 ),
  1545.                         ctlpt( E2, -0.2, 1.0 ),
  1546.                         ctlpt( E2,  0.2, 0.0 ),
  1547.                         ctlpt( E2,  0.8, 0.6 ) ) );
  1548.     s1 = CENVOFF( c1, 0.5, 0.01 );
  1549.  
  1550.  Computes an envelope offset surface for a cubic Bezier curve c1 of
  1551.  Height of 0.5 and Tolerance of 0.01.
  1552. $
  1553.  
  1554. CEVAL
  1555.  
  1556.  CtlPtType CEVAL( CurveType Curve, NumericType Param )
  1557.  
  1558.    Evaluates the provided Curve at the given Param value.
  1559.  Param should be in the curve's parametric domain if Curve is
  1560.  a Bspline curve, or between zero and one if Curve is a Bezier curve.
  1561.  The returned control point has the same point type as the control points
  1562.  of the Curve.
  1563.  
  1564.  Example:
  1565.  
  1566.     CPt = CEVAL( Crv, 0.25 );
  1567.  
  1568.  evaluates Crv at the parameter value of 0.25.
  1569. $
  1570.  
  1571. CEXTREMES
  1572.  
  1573.  ListType CEXTREMES( CurveType Crv, NumericType Epsilon, NumericType Axis )
  1574.  
  1575.    Computes the extreme set of the given Crv in the given axis (1 for X,
  1576.  2 for Y, 3 for Z). Since this computation is numeric, an Epsilon is
  1577.  also required to specify the desired tolerance. It returns a list of
  1578.  all the parameter values (NumericType) in which the curve takes an extreme
  1579.  value.
  1580.  
  1581.  Example:
  1582.  
  1583.     extremes = CEXTREMES( Crv, 0.0001, 1 );
  1584.  
  1585.  Computes the extreme set of curve crv, in the X axis, with
  1586.  error tolerance of 0.0001. See also CZERO.
  1587. $
  1588.  
  1589. CINFLECT
  1590.  
  1591.  ListType CINFLECT( CurveType Crv, NumericType Epsilon )
  1592.  
  1593.  or
  1594.  
  1595.  CurveType CINFLECT( CurveType Crv, NumericType Epsilon )
  1596.  
  1597.    Computes the inflection points of Crv in the XY plane.
  1598.  Since this computation is numeric, an Epsilon is also required
  1599.  to specify the desired tolerance. It returns a list of all the
  1600.  parameter values (NumericType) in which the curve has an inflection point.
  1601.    If, however, Epsilon is negative, a scalar field curve representing
  1602.  the sign of the curvature of the curve is returned instead.
  1603.  
  1604.  The sign of curvature scalar field is equal to
  1605.  
  1606.        s(t) = x' y'' - x'' y' 
  1607.  
  1608.  Example:
  1609.  
  1610.     inflect = CINFLECT( crv, 0.001 );
  1611.     pt_inflect = nil();
  1612.     pt = nil();
  1613.     for ( i = 1, 1, sizeof( inflect ),
  1614.             pt = ceval( crv, nth( inflect, i ) ):
  1615.             snoc( pt, pt_inflect )
  1616.         );
  1617.     interact( list( axes, crv, pt_inflect ), 0);
  1618.  
  1619.  Computes the set of inflection points of curve crv with error
  1620.  tolerance of 0.001. This set is then scanned in a loop and
  1621.  evaluated to the curve's locations which are then displayed with the crv.
  1622.  See also CZEROS, CEXTREMES, and CCRVTR.
  1623. $
  1624.  
  1625. CINTERP
  1626.  
  1627.  CurveType CINTERP( ListType PtList, NumericType Order, NumericType Size,
  1628.                                      ConstantType Param, NumericType Periodic)
  1629.  
  1630.    Computes a Bspline polynomial curve that interpolates or approximates
  1631.  the list of points in PtList. The Bspline curve will have order
  1632.  Order and Size control points, and will be periodic if
  1633.  periodic is none zero. The knots will be spaced according to
  1634.  Param which can be one of PARAM_UNIFORM, PARAM_CHORD or
  1635.  PARAM_CENTRIP. The former prescribes a uniform knot sequence and the
  1636.  latters specify knot spacing according to the chord
  1637.  length and a square root of the chord length. A periodic curve will be
  1638.  coerced to have PARAM_UNIFORM knot sequence.
  1639.    Use of Periodic end conditions can create cases with degenerated
  1640.  linear systems (determinant equal zero).  Increase or decrease of the
  1641.  Order of the Bspline by one will resolve the problem.
  1642.    All points in PtList must be of type (E1-E5, P1-P5) control point,
  1643.  or regular PointType. If Size is equal to the number of points in
  1644.  PtList the resulting curve will interpolate the data set.
  1645.  Otherwise, if Size is less than the number of points in PtList
  1646.  the point data set will be least square approximated. In no time can Size
  1647.  be lower than Order. Size of zero forces interpolation by
  1648.  setting Size to the data set size.
  1649.    All interior knots will be distinct preserving maximal continuity.
  1650.  The resulting Bspline curve will have open end conditions.
  1651.  
  1652.  Example:
  1653.  
  1654.     pl = nil();
  1655.     for ( x = 0, 1, 100,
  1656.           snoc(point(cos(x / 5), sin(x / 5), x / 50 - 1), pl)
  1657.     );
  1658.     c = CINTERP( pl, 3, 21, PARAM_UNIFORM );
  1659.  
  1660.  Samples a helical curve at 100 points and least square fit a quadratic
  1661.  Bspline curve with 21 point to the data set. The curve will have a uniform
  1662.  knot spacing.
  1663. $
  1664.  
  1665. CIRCLE
  1666.  
  1667.  CurveType CIRCLE( VectorType Center, NumericType Radius )
  1668.  
  1669.    Constructs a circle at the specified Center with the specified
  1670.  Radius. The returned circle is a Bspline curve of four piecewise Bezier
  1671.  90 degree arcs. The construced circle is always parallel to the XY plane.
  1672.  Use the linear transformation routines to place the circle in the appropriate
  1673.  orientation and location.
  1674. $
  1675.  
  1676. CIRCPOLY
  1677.  
  1678.  PolygonType CIRCPOLY( VectorType Normal, VectorType Trans, NumericType Radius )
  1679.  
  1680.    Defines a circular polygon in a plane perpendicular to Normal that
  1681.  contains the Trans point. Constructed polygon is centered at
  1682.  Trans. RESOLUTION vertices will be defined with Radius from
  1683.  distance from Trans.
  1684.  
  1685.    Alternative ways to construct a polygon are manual construction of the
  1686.  vertices using POLY, or the construction of a flat ruled surface using
  1687.  RULEDSRF.
  1688. $
  1689.  
  1690. CLNTREAD
  1691.  
  1692.  AnyType CLNTREAD( NumericType Handler, NumericType Block )
  1693.  
  1694.    Reads one object from a communication channel of a client.
  1695.  Handler contains the index of the communication channel opened via
  1696.  CLNTEXEC. If no data is available in the communication channel, this
  1697.  function will block for at most Block millisecond until data is found
  1698.  or timeout occurs. In the latter, a single StringType object is returned
  1699.  with the content of "no data (timeout)".  See also CLNTWRITE, CLNTCLOSE,
  1700.  and CLNTEXEC.
  1701.  
  1702.  Example:
  1703.  
  1704.    h2 = clntexec( "xmtdrvs -s-" );
  1705.        .
  1706.        .
  1707.  
  1708.    Model = CLNTREAD( h2 );
  1709.        .
  1710.        .
  1711.  
  1712.    clntclose( h2,TRUE );
  1713.  
  1714.  reads one object from client through communication channel h2 and save it
  1715.  in variable Model.
  1716. $
  1717.  
  1718. CMESH
  1719.  
  1720.  CurveType CMESH( SurfaceType Srf, ConstantType Direction, NumericType Index )
  1721.  
  1722.    Returns a single ROW or COLumn as specified by the Direction and
  1723.  Index (base count is 0) of the control mesh of surface Srf.
  1724.  
  1725.    The returned curve will have the same knot vector as Srf in the
  1726.  appropriate direction. See also CSURFACE.
  1727.  
  1728.    This curve is not necessarily in the surface Srf.
  1729.  
  1730.  Example:
  1731.  
  1732.     Crv = CMESH( Srf, COL, 0 );
  1733.  
  1734.  extracts the first column of surface Srf as a curve. See also
  1735.  CSURFACE.
  1736. $
  1737.  
  1738. CMORPH
  1739.  
  1740.  CurveType CMORPH( CurveType Crv1, CurveType Crv2,
  1741.                    NumericType Method, NumericType Blend )
  1742.  
  1743.  or
  1744.  
  1745.  ListType CMORPH( CurveType Crv1, CurveType Crv2,
  1746.                   NumericType Method, NumericType Blend )
  1747.  
  1748.  Creates a new curve which is a metamorph of the two given curves.
  1749.  The two given curves must be compatible (see FFCOMPAT) before this blend
  1750.  is invoked. Very useful if a sequence that "morphs" one curve to another
  1751.  is to be created. Several methods of metamorphosis are supported according
  1752.  to the value of Method,
  1753.  
  1754.  
  1755.     0   Simple convex blend.
  1756.     1   Corner/Edge cutting scheme, scaled to same curve length.
  1757.     2   Corner/Edge cutting scheme, scaled to same bounding box.
  1758.     3   Same as 1 but with filtering out of tangencies.
  1759.     4   Same as 2 but with filtering out of tangencies.
  1760.     5   Multiresolution decompsition based metamorphosis. See CMULTRES.
  1761.  
  1762.  
  1763.    In Method 1, Blend is a number between zero (Crv1)
  1764.  and one (Crv2) defining the similarity to Crv1 and Crv2,
  1765.  respectively. A single curve is returned.
  1766.  
  1767.    In Methods 2 to 5, Blend is a step size for the
  1768.  metamorphosis operation and a whole list describing the entire
  1769.  metamorphosis operation is returned.
  1770.  
  1771.  Examples:
  1772.  
  1773.     for ( i = 0, 1, 300,
  1774.         c = CMORPH( crv1a, crv1b, 0, i / 300.0 ):
  1775.         color( c, yellow ):
  1776.         viewobj( c )
  1777.     );
  1778.    
  1779.     crvs = CMORPH( crv1a, crv1b, 2, 0.003 );
  1780.     snoc( crv1b, crvs );
  1781.     for ( i = 1, 1, sizeof( crvs ),
  1782.         c = nth( crvs, i ):
  1783.         color( c, yellow ):
  1784.         viewobj( c )
  1785.     );
  1786.  
  1787.     Turtle2 = ffmatch( Wolf, Turtle, 20, 100, 2, false, 2 );
  1788.     ffcompat( Wolf, Turtle2 );
  1789.     for ( i = 0, 1, 25,
  1790.         c = CMORPH( Wolf, Turtle2, 0, i / 25 ):
  1791.         color( c, yellow ):
  1792.         viewobj( c )
  1793.     );
  1794.  
  1795.  creates three metamorphosis animation sequences, one that is based on
  1796.  a convex blend, one that is based on corner/edge cutting scheme.
  1797.  See alost SMORPH, and a third that employs FFMATCH.
  1798. $
  1799.  
  1800. CMULTIRES
  1801.  
  1802.  ListType CMULTIRES( CurveType Crv, NumericType Discont )
  1803.  
  1804.    Computes a multiresolution decomposition of curve Crv using least
  1805.  squares approximation. The resulting list of curves describes an hierarchy
  1806.  of curves in linear subspaces of the space Crv was in that can be
  1807.  sum algebraically to form Crv. Each of the curves in the hierarchy
  1808.  is a least squares approximation of Crv in the subspace it is defined
  1809.  in. Discont is a boolean flat that controls the way tangent
  1810.  discontinuities are computed throughout the decomposition.
  1811.  
  1812.  Example:
  1813.  
  1814.     MRCrv = CMULTIRES( Animal, false );
  1815.  
  1816.     sum = nth( MRCrv, 1 );
  1817.     MRCrvs = list( sum * tx( 3.0 ) );
  1818.     for ( ( i = 2 ), 1, sizeof( MRCrv ),
  1819.         sum = symbsum( sum, nth( MRCrv, i ) ):
  1820.         snoc( sum * tx( ( 3 - i ) * 1.5 ), MRCrvs )
  1821.     );
  1822.  
  1823.     All = MRCrvs * sc ( 0.25 );
  1824.     view( All, on );
  1825.  
  1826.  Computes a multiresolution decomposition to curve CrossSec as
  1827.  MRCrv and display all the decomposition levels by summing them all
  1828.  up. The use of none as on object name allows one to display an
  1829.  object in the display device without replacing the previous object in the
  1830.  display device, carrying the same name.
  1831.  
  1832.  creates two metamorphosis animation sequences, one that is based on
  1833.  a convex blend and one that is based on corner/edge cutting scheme.
  1834. $
  1835.  
  1836. CNORMAL
  1837.  
  1838.  VectorType CNORMAL( CurveType Crv, NumericType TParam )
  1839.  
  1840.    Computes the normal vector to curve Crv at the
  1841.  parameter values TParam. The returned vector has a
  1842.  unit length.
  1843.  
  1844.  Example:
  1845.  
  1846.     Normal = CNORMAL( Crv, 0.5 );
  1847.  
  1848.  computes the normal to Crv at the parameter value 0.5.
  1849.  See also CNRMLCRV.
  1850. $
  1851.  
  1852. CNRMLCRV
  1853.  
  1854.  CurveType CNRMLCRV( CurveType Crv )
  1855.  
  1856.  Symbolically computes a vector field curve representing the non-normalized
  1857.  normals of the given curve. That is a normal vector filed, evaluated at
  1858.  t, provides a vector in the direction of the normal of the original
  1859.  curve at t. The normal curve computed is in fact equal to kN where k
  1860.  is the curvature of Crv and N is its normal.
  1861.  
  1862.  Example:
  1863.  
  1864.  NrmlCrv = CNRMLCRV( Crv );
  1865. $
  1866.  
  1867. CNVXHULL
  1868.  
  1869.  PolygonType CNVXHULL( PolygonType Poly | PolylineType Poly );
  1870.  
  1871.  or
  1872.  
  1873.  CurveType CNVXHULL( CurveType Crv );
  1874.  
  1875.  Computes the convex hull of the given set of Poly or Curve.
  1876.  For curves, the result might be partial if the curve is not closed or
  1877.  periodic.  See also CRV2TANS and CRVPTTAN.
  1878.  
  1879.  Example:
  1880.  
  1881.     Pts1 = nil();
  1882.     Pts2 = nil();
  1883.     for ( i = 0, 1, 7,
  1884.         R = 0.2 + fmod( i, 2 ) / 2:
  1885.         Pt = ctlpt( E2, R * cos( i * 2 * pi / 8 ), R * sin( i * 2 * pi / 8 ) ):
  1886.         snoc( Pt, Pts1 ):
  1887.         snoc( coerce( Pt, point_type ),  Pts2 ) );
  1888.     Crv = coerce( cbspline( 4, Pts1, list( KV_PERIODIC ) ), KV_OPEN );
  1889.     CHPts = CNVXHULL( poly( Pts2, 0 ), 0 );
  1890.     CHCrv = CNVXHULL( Crv, 0 );
  1891.  
  1892.  computes the convex hull of a given control polygon and freeform curve.
  1893. $
  1894.  
  1895. COERCE
  1896.  
  1897.  AnyType COERCE( AnyType Object, ConstantType NewType )
  1898.  
  1899.    Provides a coercion mechanism between different objects or object types.
  1900.  PointType, VectorType, PlaneType, CtlPtType can be all coerced to each
  1901.  other by using the NewType of POINT_TYPE, VECTOR_TYPE, PLANE_TYPE,
  1902.  or one of E1-E5, P1-P5 (CtlPtType). Similarly, CurveType, SurfaceType,
  1903.  TrimSrfType, TriSrfType, and TrivarType can all be coerced to hold different
  1904.  CtlPtType of control points, or even different open end conditions from
  1905.  KV_PERIODIC to KV_FLOAT to KV_OPEN.
  1906.    If a scalar (E1 or P1) curve is coerced to E2 or P2 curve or
  1907.  a scalar (E1 or P1) surface is coerced to E3 or P3 surface, the Y (YZ)
  1908.  coordinate(s) is (are) updated to hold the parametric domain of the curve
  1909.  (surface).  That is X = U (Y = V).
  1910.  
  1911.  Example:
  1912.  
  1913.     CrvE2 = COERCE( Crv, E2 );
  1914.  
  1915.  coerce Crv to a new curve that will have an E2 CtlPtType control
  1916.  points. Coerction of a projective curve (P1-P5) to a Euclidean curve
  1917.  (E1-E5) does not preseve the shape of the curve.
  1918. $
  1919.  
  1920. COMPOSE
  1921.  
  1922.  CurveType COMPOSE( CurveType Crv1, CurveType Crv2 )
  1923.  
  1924.  or
  1925.  
  1926.  CurveType COMPOSE( SurfaceType Srf, CurveType Crv )
  1927.  
  1928.    Symbolically compute the composition curve Crv1(Crv2(t)) or
  1929.  Srf(Crv(t)). In Crv1(Crv2(t), Crv1 can be any curve
  1930.  while Crv2 must be a one-dimensional curve that is either E1 or
  1931.  P1. In Srf(Crv(t)), Srf can be any surface, while Crv
  1932.  must be a two-dimensional curve, that is either E2 or P2. Both Crv2
  1933.  in the curve's composition, and Crv is the surface's composition
  1934.  must be contained in the curve or surface parametric domain.
  1935.  
  1936.  Example:
  1937.  
  1938.    srf = sbezier( list( list( ctlpt( E3, 0.0, 0.0, 0.0 ),
  1939.                               ctlpt( E3, 0.0, 0.5, 1.0 ),
  1940.                               ctlpt( E3, 0.0, 1.0, 0.0 ) ),
  1941.                         list( ctlpt( E3, 0.5, 0.0, 1.0 ),
  1942.                               ctlpt( E3, 0.5, 0.5, 0.0 ),
  1943.                               ctlpt( E3, 0.5, 1.0, 1.0 ) ),
  1944.                         list( ctlpt( E3, 1.0, 0.0, 1.0 ),
  1945.                               ctlpt( E3, 1.0, 0.5, 0.0 ),
  1946.                               ctlpt( E3, 1.0, 1.0, 1.0 ) ) ) );
  1947.    crv = coerce( circle( vector( 0.0, 0.0, 1.0 ), 0.4 ), p2 ) *
  1948.          trans( vector( 0.5, 0.5, 0.0 ) );
  1949.    comp_crv = COMPOSE( srf, crv );
  1950.  
  1951.  composes a circle Crv to be on the surface Srf.
  1952. $
  1953.  
  1954. CON2
  1955.  
  1956.  PolygonType CON2( VectorType Center, VectorType Direction,
  1957.                    NumericType Radius1, NumericType Radius2 )
  1958.  
  1959.    Creates a truncated CONE geometric object, defined by Center as the
  1960.  center of the main base of the CONE, Direction as both the CONE's axis
  1961.  and the length of CONE, and the two radii Radius1/2 of the two bases of
  1962.  the CONE.
  1963.  
  1964.    Unlike the regular cone (CONE) constructor which has inherited
  1965.  discontinuities in its generated normals at the apex, CON2 can be used to
  1966.  form a (truncated) cone with continuous normals. 
  1967.    See RESOLUTION for the accuracy of the CON2 approximation as a polygonal
  1968.  model. See also CONE. See IRITSTATE's "PrimRatSrfs" and "PrimRatSrfs"
  1969.  state variables.
  1970.  
  1971.  
  1972.  Example:
  1973.  
  1974.     Cone2 = CON2( vector( 0, 0, -1 ), vector( 0, 0, 4 ), 2, 1 );
  1975.  
  1976.  constructs a truncated cone with bases parallel to the XY plane at
  1977.  Z = -1 and Z = 3, and with radii of 2 and 1 respectively.
  1978. $
  1979.  
  1980. CONE
  1981.  
  1982.  PolygonType CONE( VectorType Center, VectorType Direction,
  1983.                    NumericType Radius )
  1984.  
  1985.    Creates a CONE geometric object, defined by Center as the center of
  1986.  the base of the CONE, Direction as the CONE's axis and height, and
  1987.  Radius as the radius of the base of the CONE.
  1988.    See RESOLUTION for accuracy of the CONE approximation as a polygonal model. 
  1989.  
  1990.  Example:
  1991.  
  1992.     Cone1 = CONE( vector( 0, 0, 0 ), vector( 1, 1, 1 ), 1 );
  1993.  
  1994.  constructs a cone based in an XY parallel plane, centered at the origin
  1995.  with radius 1 and with tilted apex at ( 1, 1, 1 ).
  1996.  
  1997.    See IRITSTATE's "PrimRatSrfs" and "PrimRatSrfs" state variables.
  1998.    See also CON2.
  1999. $
  2000.  
  2001. CONTOUR
  2002.  
  2003.  PolygonType CONTOUR( SurfaceType ContouredSrf, PlaneType ContourPlane )
  2004.  
  2005.  or
  2006.  
  2007.  PolygonType CONTOUR( SurfaceType ContouredSrf, PlaneType ContourPlane,
  2008.                       SurfaceType MappedSrf )
  2009.  
  2010.    Contours surface ContouredSrf by intersecting plane ContourPlane
  2011.  with a polygonal approximating of ContouredSrf with resolution set
  2012.  via variable RESOLUTION (10 is a good starting resolutionvalue, 20 is
  2013.  extreme).
  2014.    If ContouredSrf is a scalar field surface of type E1 or P1 and
  2015.  MappedSrf is provided, ContouredSrf is contoured above its
  2016.  parametric domain (U is X, V is Y) and the resulting parametric curve
  2017.  is composed with MappedSrf to yield the returned value.
  2018.  
  2019.  Example:
  2020.  
  2021.  resolution = 20;
  2022.  nglass = snrmlsrf( glass ) * vector( 1, 1, 1 );
  2023.  
  2024.  sils = contour( nglass, plane( 1, 0, 0, 0 ), glass );
  2025.  color( sils, cyan );
  2026.  attrib( sils, "dwidth", 4 );
  2027.  
  2028.  view( list( axes, glass, sils ), on );
  2029.  
  2030.  Computes the normal field of the surface glass, project it onto
  2031.  the viewing direction of (1, 1, 1) and contour the resulting scalar field
  2032.  with the plane X = 0, to extract the silhouette curves from viewing direction
  2033.  (1, 1, 1).
  2034. $
  2035.  
  2036. CONVEX
  2037.  
  2038.  PolygonType CONVEX( PolygonType Object )
  2039.  
  2040.  or
  2041.  
  2042.  ListType CONVEX( ListType Object )
  2043.  
  2044.    Converts non-convex polygons in Object, into convex ones. New vertices
  2045.  are introduced into the polygonal data during this process. The Boolean
  2046.  operations require the input to have convex polygons only (although it may
  2047.  return non convex polygons...) and it automatically converts non-convex input
  2048.  polygons to convex ones, using this same routine.
  2049.  
  2050.    However, some external tools (like irit2ray and poly3d-h) require convex
  2051.  polygons. This function must be used on the objects to guarantee that
  2052.  only convex polygons are saved into data files for these external tools.
  2053.  
  2054.  Example:
  2055.  
  2056.     CnvxObj = CONVEX( Obj );
  2057.     save( "data", CnvxObj );
  2058.  
  2059.  converts non-convex polygons into convex ones, so that the data file can be
  2060.  used by external tools requiring convex polygons.
  2061. $
  2062.  
  2063. COORD
  2064.  
  2065.  AnyType COORD( AnyType Object, NumericType Index )
  2066.  
  2067.    Extracts an element from a given Object, at index Index. From
  2068.  a PointType, VectorType, PlaneType, CtlPtType and MatrixType, a NumericType
  2069.  is returned with Index 0 for the X axis, 1 for the Y axis etc.
  2070.  Index 0 denotes the weight of CtlPtType. For a PolygonType that
  2071.  contains more than one polygon, the Indexth polygon is returned. For
  2072.  a PolygonType that contains a single Polygon, the Indexth vertex is
  2073.  returned. For a CurveType or a SurfaceType, the Indexth CtlPtType is
  2074.  returned. For a ListType, COORD behaves like NTH and returns the Indexth
  2075.  object in the list. For a StringType, the Indexth character is returned
  2076.  as its ASCII numeric code.
  2077.  
  2078.  Example:
  2079.  
  2080.     a = vector( 1, 2, 3 );
  2081.     vector( COORD( a, 0 ), COORD( a, 1 ), COORD( a, 2 ) );
  2082.  
  2083.     a = ctlpt( P2, 6, 7, 8, 9 );
  2084.     ctlpt( P3, coord( a, 0 ), coord( a, 1 ), coord( a, 2 ), coord( a, 3 ) );
  2085.  
  2086.     a = plane( 10, 11, 12, 13 );
  2087.     plane( COORD( a, 0 ), COORD( a, 1 ), COORD( a, 2 ), COORD( a, 3 ) );
  2088.  
  2089.  constructs a vector/ctlpt/plane and reconstructs it by extracting the
  2090.  constructed scalar components of the objects using COORD.
  2091.  
  2092.    See also COERCE.
  2093. $
  2094.  
  2095. COVERISO
  2096.  
  2097.  CurveType COVERISO( TrivarType TV,
  2098.                      NumericType NewOfStrokes,
  2099.                      NumericType StrokeType,
  2100.                      PointType MinMaxPwrLen,
  2101.                      NumericType StepSize,
  2102.                      NumericType IsoVal )
  2103.  
  2104.  Computes a coverage for an iso surface of a trivariate function TV,
  2105.  using curves. NewOfStrokes strokes are distributed on the iso surface
  2106.  with length that is set via MinMaxPwrLen. MinMaxPwrLen is
  2107.  a triplet of the form (Min, Max, Power) that determines the length of the
  2108.  strokes as,
  2109.  
  2110.         Avg = (Max + Min) / 2,             Dev = (Max - Min) / 2
  2111.  
  2112.         Length = Avg + Dev * Random(0, 1) ^ Pwr.
  2113.  
  2114.  StepSize controls the steps size of the piecewise linear approximation
  2115.  formed and should be typically smaller than Min.
  2116.  StrokeType can be one of,
  2117.  
  2118.     1          Draw strokes along minimal principal curvature.
  2119.     2          Draw strokes along maximal principal curvature.
  2120.     3          Draw strokes along both principal curvatures.
  2121.     4          Draw strokes along constant X planes.
  2122.     5          Draw strokes along constant Y planes.
  2123.     6          Draw strokes along constant Z planes.
  2124.  
  2125.  Finally, IsoVal controls the constant value of the iso surface level.
  2126.  See also ADAPISO, COVERPT, MRCHCUBE, TVLOAD.
  2127.  
  2128.  Example:
  2129.  
  2130.     IsoVal = 0.12;
  2131.     Cover = CoverIso( ThreeCyls, 500, 1, vector( 3, 10, 1.0 ), 0.2, IsoVal );
  2132.  
  2133.  draws 500 strokes on the iso surface of trivariate ThreeCyls at iso
  2134.  value IsoVal and step size of 0.2.  Strokes are drawn in length of 
  2135.  3 to 10 along line of curvatures of minimal curvature.
  2136. $
  2137.  
  2138. COVERPT
  2139.  
  2140.  PolygonType COVERPT( PolygonType Model,
  2141.                       NumericType NumOfPts,
  2142.                       VectorType ViewDir )
  2143.  
  2144.  Computes a uniform point distribution on the given polygonal Model.
  2145.  Approximately NumOfPts points are uniformly distributed on the
  2146.  Model's surface, provided ViewDir is the zero vector.
  2147.  If ViewDir is a non zero vector, the distribution is made to be
  2148.  uniform from this given viewing direction.
  2149.    In all cases, NumOfPts is an upper bound the the real number of
  2150.  distributed points, which will be in the same order.
  2151.  
  2152.  See also ADAPISO, COVERISO, FFPTDIST.
  2153.  
  2154.  Example:
  2155.  
  2156.     Pts1 = CoverPt( solid1, 1000, vector( 0, 0, 0 ) );
  2157.     Pts2 = CoverPt( solid1, 1000, vector( 0, 0, 1 ) );
  2158.  
  2159.  Computes two uniform distributions of 1000 points on Solid1. Pts1
  2160.  is uniform in three space, while Pts2 which is viewed uniform from
  2161.  the Z direction.
  2162.  
  2163. $
  2164.  
  2165. CRAISE
  2166.  
  2167.  CurveType CRAISE( CurveType Curve, NumericType NewOrder )
  2168.  
  2169.    Raise Curve to the NewOrder Order specified.
  2170.  
  2171.  Example:
  2172.  
  2173.     Crv = cbezier( list( ctlpt( E2, -0.7,  0.3 ),
  2174.                          ctlpt( E2,  0.0,  1.0 ),
  2175.                          ctlpt( E2,  0.7,  0.0 ) ) );
  2176.     Crv2 = CRAISE( Crv, 5 );
  2177.  
  2178.  raises the 90 degrees corner Bezier curve Crv to be a quartic.
  2179. $
  2180.  
  2181. CREFINE
  2182.  
  2183.  CurveType CREFINE( CurveType Curve, NumericType Replace, ListType KnotList )
  2184.  
  2185.    Provides the ability to Replace a knot vector of Curve, or refine 
  2186.  it. KnotList is a list of knots to refine Curve at. All knots
  2187.  should be contained in the parametric domain of the Curve. If the knot
  2188.  vector is replaced, the length of KnotList should be identical to the
  2189.  length of the original knot vector of the Curve. If Curve is a
  2190.  Bezier curve, it is automatically promoted to be a Bspline curve.
  2191.  
  2192.  Example:
  2193.  
  2194.     Crv2 = CREFINE( Crv, FALSE, list( 0.25, 0.5, 0.75 ) );
  2195.  
  2196.  refines Crv and adds three new knots at 0.25, 0.5, and 0.75.
  2197. $
  2198.  
  2199. CREGION
  2200.  
  2201.  CurveType CREGION( CurveType Curve, NumericType MinParam,
  2202.                                                        NumericType MaxParam )
  2203.  
  2204.    Extracts a region from Curve between MinParam and MaxParam.
  2205.  Both MinParam and MaxParam should be contained in the
  2206.  parametric domain of the Curve.
  2207.  
  2208.  Example:
  2209.  
  2210.     SubCrv = CREGION( Crv, 0.3, 0.6 );
  2211.  
  2212.  extracts the region from Crv from the parameter value 0.3 to the
  2213.  parameter value 0.6.
  2214. $
  2215.  
  2216. CREPARAM
  2217.  
  2218.  CurveType CREPARAM( CurveType Curve, NumericType MinParam,
  2219.                                                        NumericType MaxParam )
  2220.  
  2221.    Reparametrize Curve over a new domain from MinParam to MaxParam.
  2222.  This operation does not affect the geometry of the curve and only affine
  2223.  transforms its knot vector. A Bezier curve will automatically be promoted
  2224.  into a Bspline curve by this function.
  2225.  
  2226.  Example:
  2227.  
  2228.     arc1 = arc( vector( 0.0, 0.0, 0.0 ),
  2229.                 vector( 0.5, 2.0, 0.0 ),
  2230.                 vector( 1.0, 0.0, 0.0 ) );
  2231.     crv1 = arc( vector( 1.0, 0.0, 0.75 ),
  2232.                 vector( 0.75, 0.0, 0.7 ),
  2233.                 vector( 0.5,  0.0, 0.85 ) ) +
  2234.            arc( vector( 0.5,  0.0, 0.75 ),
  2235.                 vector( 0.75, 0.0, 0.8 ),
  2236.                 vector( 1.0,  0.0, 0.65 ) );
  2237.  
  2238.     arc1 = CREPARAM( arc1, 0, 10 );
  2239.     crv1 = CREPARAM( crv1, 0, 10 );
  2240.  
  2241.  Sets the domain of the given two curves to be from zero to ten. The
  2242.  Bezier curve arc1 is promoted to a Bspline curve.
  2243. $
  2244.  
  2245. CROSSEC
  2246.  
  2247.  PolygonType CROSSEC( PolygonType Object )
  2248.  
  2249.    This feature is NOT implemented.
  2250. $
  2251.  
  2252. CRV2TANS
  2253.  
  2254.  ListType CRV2TANS( CurveType Crv, NumericType FineNess )
  2255.  
  2256.    Computes all the bi-tangents of Crv, in the XY plane. That
  2257.  is, all lines that are tangent to Crv at two different locations.
  2258.  Returned is a list of points with X and Y coefficients representinf the
  2259.  parametric locations on Crv of the bi-tangent.  FineNess
  2260.  controls the numerical accuracy of the computation. A value of 10 will
  2261.  provide a good start and the larger this number is, the better the
  2262.  accuracy will be. See also CRVPTTAN and CNVXHULL.
  2263.  
  2264.  Example:
  2265.  
  2266.     Tans = nil();
  2267.     Crv2Tns = Crv2Tans( Crv, 10 );
  2268.     for ( i = 1, 1, sizeof( Crv2Tns ),
  2269.         pt = nth( Crv2Tns, i ):
  2270.         snoc( ceval( Crv, coord( pt, 0 ) ) +
  2271.               ceval( Crv, coord( pt, 1 ) ), Tans ) );
  2272.  
  2273.  finds the bi-tangents of Crv and convert them to a set of line
  2274.  segments.
  2275. $
  2276.  
  2277. CRVLNDST
  2278.  
  2279.  NumericType CRVLNDST( CurveType Crv, PointType PtOnLine, VectorType LnDir,
  2280.                                  NumericType IsMinDist, NumericType Epsilon )
  2281.  
  2282.  or
  2283.  
  2284.  ListType CRVLNDST( CurveType Crv, PointType PtOnLine, VectorType LnDir,
  2285.                                 NumericType IsMinDist, NumericType Epsilon )
  2286.  
  2287.    Computes the closest (if IsMinDist is TRUE, farthest if FALSE) point
  2288.  on Curve to the line specified by PtOnLine and LnDir as a
  2289.  point on the line and a line direction.
  2290.    Since this operation is partially numeric, Epsilon is used to set
  2291.  the needed accuracy. It returns the parameter value of the location on
  2292.  Crv closest to the line.
  2293.    If, however, Epsilon is negative, -Epsilon is used instead,
  2294.  and all local extrema in the distance function are returned as a list
  2295.  (both minima and maxima).
  2296.    If the line and the curve intersect, the point of intersection is
  2297.  returned as the minimum.
  2298.  
  2299.  Example:
  2300.  
  2301.     Param = CRVLNDST( Crv, linePt, lineVec, TRUE, 0.001 );
  2302.  
  2303.  finds the closest point on Crv to the line defined by linePt
  2304.  and lineVec.
  2305. $
  2306.  
  2307. CRVPTDST
  2308.  
  2309.  NumericType CRVPTDST( CurveType Crv, PointType Point, NumericType IsMinDist,
  2310.                                                          NumericType Epsilon )
  2311.  
  2312.  or
  2313.  
  2314.  ListType CRVPTDST( CurveType Crv, PointType Point, NumericType IsMinDist,
  2315.                                                          NumericType Epsilon )
  2316.  
  2317.    Computes the closest (if IsMinDist is TRUE, farthest if FALSE) point
  2318.  on Crv to Point.
  2319.    Since this operation is partially numeric, Epsilon is used to set
  2320.  the needed accuracy. It returns the parameter value of the location on
  2321.  Crv closest to Point.
  2322.    If, however, Epsilon is negative, -Epsilon is used instead,
  2323.  and all local extrema in the distance function are returned as a list
  2324.  (both minima and maxima).
  2325.  
  2326.  Example:
  2327.  
  2328.     Param = CRVPTDST( Crv, Pt, FALSE, 0.0001 ); 
  2329.  
  2330.  finds the farthest point on Crv from point Pt.
  2331. $
  2332.  
  2333. CRVPTTAN
  2334.  
  2335.  ListType CRVPTTAN( CurveType Crv, PointType Pt, NumericType FineNess )
  2336.  
  2337.    Computes all the tangents to Crv that goes through point Pt,
  2338.  all in the XY plane. Returned is a list of points with X and Y
  2339.  coefficients representinf the parametric locations on Crv of the
  2340.  bi-tangent.  FineNess controls the numerical accuracy of the
  2341.  computation. A value of 0.01 will provide a good start and the smaller
  2342.  this number is, the better the accuracy will be. See also CRV2TANS and
  2343.  CNVXHULL.
  2344.  
  2345.  Example:
  2346.  
  2347.     Tans = nil();
  2348.     Pt = point( 2, 0, 0 );
  2349.     CrvPtTns = CrvPtTan( Crv, Pt, 0.01 );
  2350.     for ( i = 1, 1, sizeof( CrvPtTns ),
  2351.         snoc( ceval( Crv, nth( CrvPtTns, i ) ) + coerce( Pt, e3 ), Tans ) );
  2352.  
  2353.  finds the tangents of Crv through Pt and convert them to a
  2354.  set of line segments.
  2355. $
  2356.  
  2357. CSURFACE
  2358.  
  2359.  CurveType CSURFACE( SurfaceType Srf, ConstantType Direction,
  2360.                                                           NumericType Param )
  2361.  
  2362.  or
  2363.  
  2364.  CurveType CSURFACE( TriSrfType Srf, ConstantType Direction,
  2365.                                                           NumericType Param )
  2366.  
  2367.    Extract an isoparametric curve out of Srf in the specified
  2368.  Direction (ROW or COL (or DEPTH for triangular surface) at the
  2369.  specified parameter value Param.
  2370.    Param must be contained in the parametric domain of Srf in
  2371.  Direction direction.
  2372.  The returned curve is in the surface Srf.
  2373.  
  2374.  Example:
  2375.  
  2376.     Crv = CSURFACE( Srf, COL, 0.45 ); 
  2377.  
  2378.  extracts an isoparametric curve in the COLumn direction at the parameter
  2379.  value of 0.15 from surface Srf. See also CMESH, COMPOSE.
  2380. $
  2381.  
  2382. CTANGENT
  2383.  
  2384.  VectorType CTANGENT( CurveType Curve, NumericType Param )
  2385.  
  2386.    Computes the tangent vector to Curve at the parameter value Param.
  2387.    The returned vector has a unit length.
  2388.  
  2389.  Example:
  2390.  
  2391.     Tang = CTANGENT( Crv, 0.5 );
  2392.  
  2393.  computes the tangent vector to Crv at the parameter value of 0.5.
  2394. $
  2395.  
  2396. CTLPT
  2397.  
  2398.  CPt = CTLPT( ConstantType PtType, NumericType Coord1, ... )
  2399.  
  2400.    Constructs a single control point to be used in the construction of curves
  2401.  and surfaces. Points can have from one to five dimensions, and may be
  2402.  either Euclidean or Projective (rational). Points' type is set via the
  2403.  constants E1 to E5 and P1 to P5. The coordinates of the point are specified
  2404.  in order, weight is first if rational.
  2405.  
  2406.  Examples:
  2407.  
  2408.     CPt1 = CTLPT( E3, 0.0, 0.0, 0.0 );
  2409.     CPt2 = CTLPT( P2, 0.707, 0.707, 0.707 );
  2410.  
  2411.  constructs an E3 point at the origin and a P2 rational point with
  2412.  a weight of 0.707. The Projective Pi points are specified as
  2413.  CTLPT(Pn, W, W X1, ... , W Xn).
  2414. $
  2415.  
  2416. CTRIMSRF
  2417.  
  2418.  ListType CTRIMSRF( TrimSrfType TSrf, NumericType Parametric )
  2419.  
  2420.    Extract the trimming curves of a trimmed surface TSrf.
  2421.  If Parametric is not zero, then the trimming curves are extracted
  2422.  as parametric space curves of TSrf. Otherwise, the trimming curves
  2423.  are evaluated into Euclidean space as curves on surface TSrf.
  2424.  
  2425.  Example:
  2426.  
  2427.     TrimCrvs = CTRIMSRF( TrimSrf, FALSE ); 
  2428.  
  2429.  extracts the trimming curves of TrimSrf as Euclidean curves on
  2430.  TrimSrf.
  2431. $
  2432.  
  2433. CYLIN
  2434.  
  2435.  PolylineType CYLIN( VectorType Center, VectorType Direction,
  2436.                      NumericType Radius )
  2437.  
  2438.    Creates a CYLINder geometric object, defined by Center as center of
  2439.  the base of the CYLINder, Direction as the CYLINder's axis and height,
  2440.  and Radius as the radius of the base of the CYLINder.
  2441.    See RESOLUTION for the accuracy of the CYLINder approximation as a
  2442.  polygonal model. See IRITSTATE's "PrimRatSrfs" and "PrimRatSrfs" state
  2443.  variables.
  2444.  
  2445.  Example:
  2446.  
  2447.     Cylinder1 = CYLIN( vector( 0, 0, 0 ), vector( 1, 0, 0 ), 10 );
  2448.  
  2449.  constructs a cylinder along the X axis from the origin to X = 10.
  2450. $
  2451.  
  2452. CZEROS
  2453.  
  2454.  ListType CZEROS( CurveType Crv, NumericType Epsilon, NumericType Axis )
  2455.  
  2456.    Computes the zero set of the given Crv in the given axis (1 for X,
  2457.  2 for Y, 3 for Z). Since this computation is numeric, an Epsilon is
  2458.  also required to specify the desired tolerance. It returns a list of
  2459.  all the parameter values (NumericType) the curve is zero.
  2460.  
  2461.  Example:
  2462.  
  2463.     xzeros = CZEROS( cb, 0.001, 1 );
  2464.     pt_xzeros = nil();
  2465.     pt = nil();
  2466.     for ( i = 1, 1, sizeof( xzeros ),
  2467.             pt = ceval( cb, nth( xzeros, i ) ):
  2468.             snoc( pt, pt_xzeros )
  2469.         );
  2470.     interact( list( axes, cb, pt_xzeros ), 0 );
  2471.  
  2472.  Computes the X zero set of curve cb with error tolerance
  2473.  of 0.001. This set is then scanned in a loop and evaluated to
  2474.  the curve's locations, which are then displayed.
  2475.  See also CINFLECT.
  2476. $
  2477.  
  2478. EVOLUTE
  2479.  
  2480.  CurveType EVOLUTE( CurveType Curve )
  2481.  
  2482.  or
  2483.  
  2484.  SurfaceType EVOLUTE( SurfaceType Curve )
  2485.  
  2486.    Computes the evolute of a curve or a surface.
  2487.  For curves, the evolute is defined as,
  2488.  
  2489.                N(t)
  2490.  E(t) = C(t) + ----
  2491.                k(t)
  2492.  
  2493.  where N(t) is the unit normal of C(t) and k(t) is its curvature.
  2494.  E(t) is computed symbolically as the symbolic sum of C(t) and
  2495.  N(t) / k(t).
  2496.  For surfaces, this function computes the mean evulate which is equal to,
  2497.  
  2498.                       n(u, v)
  2499.  E(u, v) = S(u, v) + ---------
  2500.                      2 H(u, v)
  2501.  
  2502.  where n(u, v) is the unit normal of S(u, v) and H(u, v) is its mean
  2503.  curvature. E(u, v) is computed symbolically.
  2504.  
  2505.  The result of this symbolic computation is exact (upto machine precision)
  2506.  unlike a similar operations that are only approximated, like the OFFSET or
  2507.  the AOFFSET.
  2508.  
  2509.  Example:
  2510.  
  2511.     crv = cbspline( 3,
  2512.                     list( ctlpt( E3, -1.0,  0.1,  0.2 ),
  2513.                           ctlpt( E3, -0.1,  1.0,  0.1 ),
  2514.                           ctlpt( E3,  0.1,  0.1,  1.0 ),
  2515.                           ctlpt( E3,  1.0,  0.1,  0.1 ),
  2516.                           ctlpt( E3,  0.1,  1.0,  0.2 ) ),
  2517.                     list( KV_OPEN ) );
  2518.     cev = EVOLUTE( Crv );
  2519. $
  2520.  
  2521. EXTRUDE
  2522.  
  2523.  PolygonType EXTRUDE( PolygonType Object, VectorType Dir )
  2524.  
  2525.  or
  2526.  
  2527.  SurfaceType EXTRUDE( CurveType Object, VectorType Dir )
  2528.  
  2529.    Creates an extrusion of the given Object. If Object is a
  2530.  PolygonObject, its first polygon is used as the base for the extrusion in
  2531.  Dir direction, and a closed PolygonObject is constructed. If Object
  2532.  is a CurveType, an extrusion surface is constructed instead, which is not
  2533.  a closed object (the two bases of the extrusion are excluded, and the curve
  2534.  may be open by itself).
  2535.  
  2536.    Direction Dir cannot be coplanar with the polygon plane. The curve
  2537.  may be nonplanar.
  2538.  
  2539.  Example:
  2540.  
  2541.     Cross = cbspline( 3,
  2542.                       list( ctlpt( E2, -0.018, 0.001 ),
  2543.                             ctlpt( E2,  0.018, 0.001 ),
  2544.                             ctlpt( E2,  0.019, 0.002 ),
  2545.                             ctlpt( E2,  0.018, 0.004 ),
  2546.                             ctlpt( E2, -0.018, 0.004 ),
  2547.                             ctlpt( E2, -0.019, 0.001 ) ),
  2548.                       list( KV_OPEN ) );
  2549.     Cross = Cross + -Cross * scale( vector( 1, -1, 1 ) );
  2550.     Napkin = EXTRUDE( Cross * scale( vector( 1.6, 1.6, 1.6 ) ),
  2551.                       vector( 0.02, 0.03, 0.2 ) );
  2552.  
  2553.  constructs a closed cross section Cross by duplicating one half of
  2554.  it in reverse and merging the two sub-curves. Cross is then used as
  2555.  the cross-section for the extrusion operation.
  2556. $
  2557.  
  2558. FFCOMPAT
  2559.  
  2560.  FFCOMPAT( CurveType Crv1, CurveType Crv2 )
  2561.  
  2562.  or
  2563.  
  2564.  FFCOMPAT( SurfaceType Srf1, SurfaceType Srf2 )
  2565.  
  2566.  Makes the given two curves or surfaces compatible by making them share the
  2567.  same point type, same curve type, same degree, and the same continuity.
  2568.  Same point type is gained by promoting a lower dimension into a higher one,
  2569.  and non-rational to rational points. Bezier curves are promoted to Bspline
  2570.  curves if necessary, for curve type compatibility. Degree compatibility is
  2571.  achieved by raising the degree of the lower order curve. Continuity is
  2572.  achieve by refining both curves to the space with the same (unioned) knot
  2573.  vector. This function returns nothing and compatibility is made
  2574.  in place.
  2575.  
  2576.  Example:
  2577.  
  2578.  FFCOMPAT( Srf1, Srf2 );
  2579.  
  2580.  See also CMORPH and SMORPH.
  2581. $
  2582.  
  2583. FFCTLPTS
  2584.  
  2585.  ListType FFCTLPTS( CurveType Crv );
  2586.  
  2587.  or
  2588.  
  2589.  ListType FFCTLPTS( SurfaceType Srf );
  2590.  
  2591.  or
  2592.  
  2593.  ListType FFCTLPTS( TrimSrfType Srf );
  2594.  
  2595.  or
  2596.  
  2597.  ListType FFCTLPTS( TrivarType Srf );
  2598.  
  2599.  Returns all the control points of the given freeform in a single list.
  2600.  See Also FFKNTVEC, FFMSIZE, FFORDER, FFPTTYPE.
  2601.  
  2602.  Example:
  2603.  
  2604.  Ctls = FFCTLPTS( Srf1 );
  2605. $
  2606.  
  2607. FFEXTREME
  2608.  
  2609.  CtlPtType FFEXTREME( CurveType Crv, NumericType Minimum )
  2610.  
  2611.  or
  2612.  
  2613.  CtlPtType FFEXTREME( SurfaceType Srf, NumericType Minimum )
  2614.  
  2615.  Computes a bound on the extreme values a curves Crv or surface
  2616.  Srf can assume. Returned control points provides a bound on the
  2617.  minimum (maximum) values that can be assumed if Minimum is TRUE
  2618.  (FALSE).
  2619.  
  2620.  Example:
  2621.  
  2622.  Bound = FFEXTREME( Srf, false );
  2623.  
  2624.  Computes a bound on the maximal values Srf can assume.
  2625. $
  2626.  
  2627. FFKNTVEC
  2628.  
  2629.  ListType FFKNTVEC( CurveType Crv )
  2630.  
  2631.  or
  2632.  
  2633.  ListType FFKNTVEC( SurfaceType Srf )
  2634.  
  2635.  or
  2636.  
  2637.  ListType FFKNTVEC( TrimSrfType TrimSrf )
  2638.  
  2639.  or
  2640.  
  2641.  ListType FFKNTVEC( TrivarType Trivar )
  2642.  
  2643.  or
  2644.  
  2645.  ListType FFKNTVEC( TriSrfType TriSrf )
  2646.  
  2647.  Returns all the knot vector(s) of the given freeform in a list of knot
  2648.  vector(s).  See Also FFCTLPTS, FFMSIZE, FFORDER, FFPTTYPE.
  2649.  
  2650.  Example:
  2651.  
  2652.  KVs = FFKNTVEC( Srf1 );
  2653. $
  2654.  
  2655. FFMATCH
  2656.  
  2657.  FFMATCH( CurveType Crv1, CurveType Crv2, NumericType Reduce,
  2658.           NumericType Samples, NumericType ReparamOrder,
  2659.           NumericType Rotate, NumericType NormType )
  2660.  
  2661.  Computes a reparametrization to Crv2 so it fits Crv1, the best
  2662.  under some prescribed norm, NormType. Currently the following norms
  2663.  are valid for NormType
  2664.  
  2665.     Value      Description
  2666.     1          Suitable for ruled and blended curves, for modeling.
  2667.                See RULEDSRF.
  2668.     2          Suitable for metamorphosis of curves. See CMORPH.
  2669.     3          Distance norm in "walking the dog" notion.
  2670.     4          Bisector (skeleton) matching norm for two curves.
  2671.  
  2672.  Whenever negative norms can result (for example, in cases were self
  2673.  intersection cannot be prevented in ruled surface constructions), one can
  2674.  allow negativity with no extra penalty by applaying neative NormType.
  2675.    Use of positive only norms would yield no output at all if no matching
  2676.  with positive weights can be established whereas allowing negative
  2677.  norm values would result in the globally optimal result, but with possibly
  2678.  self intersectiions.
  2679.  
  2680.  The reparametrization is computed by sampling a fix set of size Samples
  2681.  off both curves, and fitting a Bspline curve of length Reduce as the
  2682.  reparametrization curve. Hence, Reduce must be less than or equal to
  2683.  Samples. The reparametrization curve will have order of
  2684.  ReparamOrder. If Rotate is TRUE or ON, then attempt is made
  2685.  to rotate the reparametrization of the curves. Rotation can be used on
  2686.  closed curves only.
  2687.  
  2688.  See RULEDSRF and CMORPH for examples.
  2689. $
  2690.  
  2691. FFMERGE
  2692.  
  2693.  CurveType FFMERGE( ListType E1Curves, NumericType PointType )@
  2694.  
  2695.  or
  2696.  
  2697.  SurfaceType FFMERGE( ListType E1Surfaces, NumericType PointType )
  2698.  
  2699.  Merges the scalar curves in the list of curves E1Curves or list
  2700.  of surfaces E1Surfaces to one vector curve/surface of point type
  2701.  PointType.
  2702.  
  2703.  Example:
  2704.  
  2705.  Srf = FFMERGE( list( SrfW, SrfX, SrfY ), P2 );
  2706.  
  2707.  merges three scalar surfaces into a single surface with point type P2.
  2708.  See also FFSPLIT, FFPTTYPE.
  2709. $
  2710.  
  2711. FFMSIZE
  2712.  
  2713.  ListType FFMSIZE( CurveType Crv )
  2714.  
  2715.  or
  2716.  
  2717.  ListType FFMSIZE( SurfaceType Srf )
  2718.  
  2719.  or
  2720.  
  2721.  ListType FFMSIZE( TrimSrfType TrimSrf )
  2722.  
  2723.  or
  2724.  
  2725.  ListType FFMSIZE( TrivarType Trivar )
  2726.  
  2727.  or
  2728.  
  2729.  ListType FFMSIZE( TriSrfType TriSrf )
  2730.  
  2731.  Returns the size of the control mesh/polygon of the given freeform in a list.
  2732.  See Also FFCTLPTS, FFKNTVEC, FFORDER, FFPTTYPE.
  2733.  
  2734.  Example:
  2735.  
  2736.  MSizes = FFMSIZE( Srf1 );
  2737. $
  2738.  
  2739. FFORDER
  2740.  
  2741.  ListType FFORDER( CurveType Crv )
  2742.  
  2743.  or
  2744.  
  2745.  ListType FFORDER( SurfaceType Srf )
  2746.  
  2747.  or
  2748.  
  2749.  ListType FFORDER( TrimSrfType TrimSrf )
  2750.  
  2751.  or
  2752.  
  2753.  ListType FFORDER( TrivarType Trivar )
  2754.  
  2755.  or
  2756.  
  2757.  ListType FFORDER( TriSrfType TriSrf )
  2758.  
  2759.  Return all the orders of the given freeform in a single list.
  2760.  See Also FFCTLPTS, FFKNTVEC, FFMSIZE, FFPTTYPE.
  2761.  
  2762.  Example:
  2763.  
  2764.  Orders = FFORDER( Srf1 );
  2765. $
  2766.  
  2767. FFPOLES
  2768.  
  2769.  NumericType FFPOLES( CurveType Crv );
  2770.  
  2771.  or
  2772.  
  2773.  NumericType FFPOLES( SurfaceType Srf );
  2774.  
  2775.  or
  2776.  
  2777.  NumericType FFPOLES( TrimSrfType TrimSrf );
  2778.  
  2779.  or
  2780.  
  2781.  NumericType FFPOLES( TrivarType Trivar );
  2782.  
  2783.  or
  2784.  
  2785.  NumericType FFPOLES( TriSrfType TriSrf );
  2786.  
  2787.  Returns TRUE in the given freeform has poles, FALSE otherwise.
  2788.  Poles are zeros in the weights of rational functions.
  2789.  
  2790.  Example:
  2791.  
  2792.  HasPoles = FFPOLES( Srf1 );
  2793. $
  2794.  
  2795. FFPTDIST
  2796.  
  2797.  ListType FFPTDIST( CurveType Crv, NumericType Euclid, NumericType NumOfPts )
  2798.  
  2799.  or
  2800.  
  2801.  ListType FFPTDIST( SurfaceType Srf, NumericType Euclid, NumericType NumOfPts )
  2802.  
  2803.     Computes a uniform point distribution for a Crv or Srf.  If
  2804.  Euclid is FALSE the distribution is selected to be uniform in the
  2805.  parametric space, otherwise if TRUE, the distribution is made uniform in the
  2806.  Euclidean space. NumOfPts sets the number of points in the distribution.
  2807.  
  2808.     The returned list of points prescribes parameters values in the freeforms.
  2809.  For Crv, the returned list is a list of reals, in the parameter space
  2810.  of Crv.  For Srf, the returned list is a list of points, whose
  2811.  X and Y coefficients holds the U and V parameters of Srf.
  2812.  See also COVERPT.
  2813.  
  2814.  Example:
  2815.  
  2816.     c1 = cbezier( list( ctlpt( E2, -1.0,  0.0 ),
  2817.                         ctlpt( E2, -1.0,  0.1 ),
  2818.                         ctlpt( E2, -0.9, -0.1 ),
  2819.                         ctlpt( E2,  0.9,  0.0 ) ) );
  2820.     color( c1, magenta );
  2821.     
  2822.     pts = FFPTDIST( c1, false, 300 );
  2823.     e2pts = nil();
  2824.     for ( i = 1, 10, sizeof( pts ),
  2825.             pt = ceval( c1, coord( nth( pts, i ), 0 ) ):
  2826.             snoc( pt, e2pts )
  2827.         );
  2828.     interact( list( e2pts, c1 ) );
  2829.     
  2830.     pts = FFPTDIST( c1, true, 300 );
  2831.     e2pts = nil();
  2832.     for ( i = 1, 10, sizeof( pts ),
  2833.             pt = ceval( c1, coord( nth( pts, i ), 0 ) ):
  2834.             snoc( pt, e2pts )
  2835.         );
  2836.     interact( list( e2pts, c1 ) );
  2837.  
  2838.    Computes the distribution of 100 points in curve c1 which has 
  2839.  highly nonuniform speed characteristics.  Two distributions are computed,
  2840.  one to be uniform in the parametric space and one uniform in the Euclidean
  2841.  space.
  2842. $
  2843.  
  2844. FFPTTYPE
  2845.  
  2846.  NumericType FFPTTYPE( CurveType Crv )
  2847.  
  2848.  or
  2849.  
  2850.  NumericType FFPTTYPE( SurfaceType Srf )
  2851.  
  2852.  or
  2853.  
  2854.  NumericType FFPTTYPE( TrimSrfType Srf )
  2855.  
  2856.  or
  2857.  
  2858.  NumericType FFPTTYPE( TrivarType )
  2859.  
  2860.  Returns the point type (E2, P4 etc.) of the given freeform.
  2861.  See Also FFCTLPTS, FFKNTVEC, FFMSIZE, FFORDER.
  2862. $
  2863.  
  2864. FFSPLIT
  2865.  
  2866.  ListType FFSPLIT( CurveType Crv )
  2867.  
  2868.  or
  2869.  
  2870.  ListType FFSPLIT( SurfaceType Srf )
  2871.  
  2872.  Splits the given curve Crv or surface Srf into its scalar
  2873.  components that are returned as a list of curves/surfaces.
  2874.  
  2875.  Example:
  2876.  
  2877.  E1Srfs = FFSPLIT( circle( vector( 0, 0, 0 ), 1 ) );
  2878.  
  2879.  splits the circle which is a curve in P3 into four scalar curves (W, X, Y, Z)
  2880.  that are returned in a single list.
  2881.  See also FFMERGE, FFPTTYPE.
  2882. $
  2883.  
  2884. GBOX
  2885.  
  2886.  PolygonType GBOX( VectorType Point,
  2887.                    VectorType Dx, VectorType Dy, VectorType Dz )
  2888.  
  2889.    Creates a parallelepiped - Generalized BOX polygonal object, defined by
  2890.  Point as base position, and Dx, Dy, Dz as 3 3D vectors to define
  2891.  the 6 faces of this generalized BOX. The regular BOX object is a special case
  2892.  of GBOX where Dx = vector(Dx, 0, 0), Dy = vector(0, Dy, 0), and
  2893.  Dz = vector(0, 0, Dz).
  2894.  
  2895.    Dx, Dy, Dz must all be independent in order to create an
  2896.  object with positive volume.
  2897.  
  2898.  Example:
  2899.  
  2900.     GB = GBOX( vector( 0.0, -0.35, 0.63 ), vector(  0.5, 0.0, 0.5 ),
  2901.                                            vector( -0.5, 0.0, 0.5 ),
  2902.                                            vector(  0.0, 0.7, 0.0 ) );
  2903. $
  2904.  
  2905. GETATTR
  2906.  
  2907.  AnyType GETATTR( AnyType Obj, StringType Name )
  2908.  
  2909.    Provides a mechanism to fetch an attribute named Name from object
  2910.  Obj.
  2911.  
  2912.  Example:
  2913.  
  2914.     attrib( axes, "test", 15 );
  2915.     a = GETATTR( axes, "test" );
  2916.  
  2917.  will set the value of a to be 15.
  2918. $
  2919.  
  2920. GETLINE
  2921.  
  2922.  AnyType GETLINE( NumericType RequestedType )
  2923.  
  2924.    Provides a method to get input from keyboard within functions and
  2925.  or subroutines. RequestedType can be one of NUMERIC_TYPE,
  2926.  POINT_TYPE, VECTOR_TYPE, or PLANE_TYPE in which the entered line
  2927.  will be parsed into one, three, or four numeric values (sperated by
  2928.  either spaces or commas) and the proper object will be created and
  2929.  returned. In any other case, including failure to parse the numeric
  2930.  input, a STRING_TYPE object will be constructed from the entered line.
  2931.  
  2932.  Example:
  2933.  
  2934.     Pt = GETLINE( point_type );
  2935.  
  2936.  to read one point (three numeric values) from stdin.
  2937. $
  2938.  
  2939. GPOLYGON
  2940.  
  2941.  PolygonType GPOLYGON( GeometryTreeType Object, NumericType Normals )
  2942.  
  2943.    Approximates all Surface(s)/Trimmed surface(s)/Trivariate(s) in Object
  2944.  with polygons using the RESOLUTION and FLAT4PLY variables. The larger the
  2945.  RESOLUTION is, the finer (more polygons) the resulting approximation will be.
  2946.  
  2947.    FLAT4PLY is a Boolean flag controlling the conversion of an (almost) flat
  2948.  patch into four (TRUE) or two (FALSE) polygons. Normals are computed to
  2949.  polygon vertices using surface normals, so Gouraud or Phong shading can be
  2950.  exploited. It returns a single polygonal object.
  2951.  
  2952.    If Normals is set, surface normals will be evaluated at the
  2953.  vertices. Otherwise flat shading and constant normals across polygons are
  2954.  assumed.
  2955.  
  2956.  Example:
  2957.  
  2958.     Polys = GPOLYGON( list( Srf1, Srf2, Srf3 ), off );
  2959.  
  2960.  Converts to polygons the three surfaces Srf1, Srf2, and Srf3
  2961.  with no normals.
  2962. $
  2963.  
  2964. GPOLYLINE
  2965.  
  2966.  PolylineType GPOLYLINE( GeometryTreeType Object, NumericType Optimal )
  2967.  
  2968.    Converts all Curves(s), (Trimmed) Surface(s), and Trivariate(s) Object
  2969.  into polylines using the RESOLUTION variable. The larger the RESOLUTION is,
  2970.  the finer the resulting approximation will be. It returns a single polyline
  2971.  object.
  2972.  
  2973.    If Optimal is false, the points are sampled at equally spaced
  2974.  interval in the parametric space. If Optimal true, a better, more
  2975.  expensive computationally, algorithm is used to derive optimal sampling
  2976.  locations as to minimize the maximal distance between the curve and
  2977.  piecewise linear approximation (L infinity norm).
  2978.  
  2979.  Example:
  2980.  
  2981.     Polys = GPOLYLINE( list( Srf1, Srf2, Srf3, list( Crv1, Crv2, Crv3 ) ),
  2982.                        on );
  2983.  
  2984.  converts to polylines the three surfaces Srf1, Srf2, and Srf3
  2985.  and the three curves Crv1, Crv2, and Crv3.
  2986. $
  2987.  
  2988. HERMITE
  2989.     
  2990.  SurfaceType HERMITE( CurveType Bndry1, CurveType Bndry2,
  2991.                       CurveType Tan1, CurveType Tan2 )
  2992.  
  2993.  or
  2994.  
  2995.  CurveType HERMITE( PointType Bndry1, PointType Bndry2,
  2996.                     VectorType Tan1, VectorType Tan2 )
  2997.  
  2998.  Constructs a cubic fit between Bndry1 and Bndry2 so that
  2999.  first derivative continuity constraints, as prescribed by Tan1 at
  3000.  Bndry1 and Tan2 at Bndry2, are preserved.
  3001.  
  3002.  Returns either a curve or a surface, according to type of input parameters.
  3003.  
  3004.  Example:
  3005.  
  3006.     h00 = HERMITE( point( 0, 0, 0 ),
  3007.                    point( 1, 1, 0 ),
  3008.                    vector( 1, 0, 0 ),
  3009.                    vector( 1, 0, 0 ) );
  3010.  Constructs a curve in the shape of the first basis function of the cubic
  3011.  Hermite basis functions.
  3012. $
  3013.  
  3014. INSTANCE
  3015.  
  3016.  InstanceType INSTANCE( GeometryType Geom );
  3017.  
  3018.  Creates an instance of the geometry prescribed by Geom. The instance
  3019.  is created with a unit transformation matrix that can be modified using
  3020.  a product with a matrix object.
  3021.  
  3022.    The use of instances is advantageous where the same geometry is to be
  3023.  displayed/processed in several different locations in space.  A modification
  3024.  of the original geometry Geom will affect all instances that reference
  3025.  it.  The reference is by the original object's name.  The original
  3026.  object can be a single object or a whole hierarchy of objects.
  3027.  
  3028.  Example:
  3029.  
  3030.     Tea1 = INSTANCE( "Teapot" ) * trans( vector(  10, 0, 0 ) );
  3031.     Tea2 = INSTANCE( "Teapot" ) * trans( vector(  20, 0, 0 ) );
  3032.     Tea3 = INSTANCE( "Teapot" ) * trans( vector(  30, 0, 0 ) );
  3033.     viewobj( list( Teapot, Tea1, Tea2, Tea3 ) );
  3034.  
  3035.  will display four teapots 10 units apart in X.
  3036.  
  3037.  As an instance is affected by an application of a transformation to it,
  3038.  if both the original object and the instance are in the same hierarchy,
  3039.  the transformation of the hierarchy will affect the instance twice:
  3040.  
  3041.    chair = chair();  # Creates a chair object using chair function
  3042.    chairInst = INSTANCE( "chair" ) * tx( 1 );
  3043.    Hier = list( chair, chairInst ) * ty( 1 ); 
  3044.  
  3045.  will, in Hier, translate chair to (0, 1, 0) but will translate
  3046.  chairInst to (1, 2, 0) or translate twice in y (once chair and once
  3047.  chairInst).
  3048. $
  3049.  
  3050. LOFFSET
  3051.     
  3052.  CurveType LOFFSET( CurveType Crv, NumericType OffsetDistance,
  3053.                     NumericType NumOfSamples, NumericType NumOfDOF,
  3054.                     NumericType Order )
  3055.  
  3056.  Approximate an offset of OffsetDistance by sampling NumOfSamples
  3057.  samples along the offset curve and least square fitting them using a Bspline
  3058.  curve of order Order and NumOfDOF control points.
  3059.  
  3060.  Example:
  3061.  
  3062.     OffCrv1 = LOFFSET( Crv, -0.4, 100, 10, 4 );
  3063.  See also OFFSET, AOFFSET, and MOFFSET.
  3064. $
  3065.  
  3066. MERGEPOLY
  3067.  
  3068.  PolygonType MERGEPOLY( ListType PolyList )
  3069.  
  3070.  Merges a set of polygonal objects in PolyList list to a single polygonal
  3071.  object. All elements in ObjectList must be of PolygonType type. This
  3072.  function performs the same operation as the overloaded ^ operator
  3073.  would, but might be more convenient to use under some circumstances.
  3074.  
  3075.  Example:
  3076.  
  3077.     Vrtx1 = vector( -3, -2, -1 );
  3078.     Vrtx2 = vector( 3, -2, -1 );
  3079.     Vrtx3 = vector( 3, 2, -1 );
  3080.     Vrtx4 = vector( -3, 2, -1 );
  3081.     Poly1 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ), false ); 
  3082.     
  3083.     Vrtx1 = vector( -3, 2, 1 );
  3084.     Vrtx2 = vector( 3, 2, 1 );
  3085.     Vrtx3 = vector( 3, -2, 1 );
  3086.     Vrtx4 = vector( -3, -2, 1 );
  3087.     Poly2 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ), false );
  3088.     
  3089.     Vrtx1 = vector( -3, -2, 1 );
  3090.     Vrtx2 = vector( 3, -2, 1 );
  3091.     Vrtx3 = vector( 3, -2, -1 );
  3092.     Vrtx4 = vector( -3, -2, -1 );
  3093.     Poly3 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ), false );
  3094.    
  3095.     PolyObj = MERGEPOLY( list( Poly1, Poly2, Poly3 ) );
  3096. $
  3097.  
  3098. MOFFSET
  3099.  
  3100.  CurveType MOFFSET( CurveType Crv, NumericType OffsetDistance,
  3101.                     NumericType AngularError )
  3102.  
  3103.  Computes an offset of OffsetDistance with globally bounded error
  3104.  (controlled by AngularError). The smaller AngularError is, the better
  3105.  the approximation to the offset. The bounded error is achieved by adaptive
  3106.  refinement of the Crv.
  3107.    The offset is computed via matching of the tangent fields of the
  3108.  given curve Crv and an arc spanning the same angular domain.
  3109.    Further, AngularError measures the angular deviation allowed
  3110.  between the two tangent fields.
  3111.  
  3112.  Example:
  3113.  
  3114.     OffCrv1 = MOFFSET( Crv, -0.4, 10 );
  3115.     OffCrv2 = MOFFSET( Crv, -0.4, 5 );
  3116.  
  3117.  computes an offset approximation to Crv with OffsetDistance of
  3118.  -0.4 and AngularError of 10 and 5 degrees, respectively.
  3119.  See also OFFSET, AOFFSET, LOFFSET, and FFMATCH.
  3120. $
  3121.  
  3122. MOMENT
  3123.     
  3124.  PointType MOMENT( CurveType Crv, 0 );
  3125.  
  3126.  or
  3127.  
  3128.  VectorType MOMENT( CurveType Crv, 1 );
  3129.  
  3130.  Approximates the zero and first moment of curve Crv.
  3131.  
  3132.  Example:
  3133.  
  3134.     a = circle( vector( 0, 0, 0 ), 1 );
  3135.     a = cregion( a, 0, 1 );
  3136.     p = moment( a, 0 );
  3137.     v = moment( a, 1 );
  3138.     view(list(a, p, v), on);
  3139.  
  3140.     a = cregion( a, 0, 1 ) * rz( 45 );
  3141.     p = moment( a, 0 );
  3142.     v = moment( a, 1 );
  3143.     view(list(a, p, v), on);
  3144.  
  3145.  computes and displays the zero and first moment of a quarter of a circle
  3146.  in two orientations.
  3147. $
  3148.  
  3149. MRCHCUBE
  3150.  
  3151.  PolygonType MRCHCUBE( ListType VolumeSpec,
  3152.                        PointType CubeDim,
  3153.                        NumericType SkipFactor,
  3154.                        NumericType IsoVal )
  3155.  
  3156.  Applies (a variation of) the marching cubes algorithm (see
  3157.  W. E.Lorensen and H. E.Cline. "Marching Cubes: A High Resolution 3D
  3158.  Surface Construction Algorithm." Computer Graphics (SIGGRAPH '87
  3159.  Proceedings), Vol. 21, No. 4, pp 163-169, July 1987.) to the given
  3160.  volumetric data set or trivariate.  VolumeSpec can be a list of
  3161.  three or five objects as follows:
  3162.  
  3163.     3          a triplet of the form
  3164.    
  3165.            (TrivarType TV, NumericType Axis, NumericType TVNormal)
  3166.     5          a 5-tuple of the form
  3167.    
  3168.            (StringType FileName, NumericType DataType, NumericType Width,
  3169.    
  3170.                                     NumericType Height, NumericType Depth )
  3171.  
  3172.  In the first case, the trivariate TV is iso surface contoured at level
  3173.  IsoVal along the prescribed Axis (Note a trivariate need not
  3174.  be a scalar function, while Marching Cubes assumes a scalar function).
  3175.  If TVNormals is not zero, much more accurate normals are derived using
  3176.  the trivariate function which is also slower.  Otherwise, first order
  3177.  differencing on the cubes is employed for normal estimation.
  3178.  
  3179.  In the second case, the volume file prescribed by FileName is
  3180.  loaded and iso surface contoured.  The file is assumed to hold
  3181.  Width * Height * Depth (Width first, Depth order last) scalar
  3182.  numeric values of type DataType:
  3183.  
  3184.     1          Regular ascii (separated by while spaces)
  3185.     2          Two bytes short integer.
  3186.     3          Four bytes long integer.
  3187.     4          One byte (char) integer.
  3188.     5          Four bytes float.
  3189.     6          Eight bytes double.
  3190.  
  3191.  Beware of the little vs big Endian problem! We assume here you read in the
  3192.  volume in the same machine type this file was writeen with.
  3193.  
  3194.  CubeDim allows the user to prescribe the real cell size (not
  3195.  necessarily cubical. SkipFactor allow the skipping ofdata in large
  3196.  data sets. SkipFactor = 1 skips nothing. SkipFactor = 2, skips
  3197.  every other scalar value, reducing in half all dimensions, etc.
  3198.  Last but not least, IsoVal sets the iso surface level.
  3199.  
  3200.  See also COVERISO, TVLOAD, and TMORPH.
  3201.  
  3202.  Example:
  3203.  
  3204.     IsoSrf = MRCHCUBE( list( ThreeCyls, 1, TRUE ), point( 1, 1, 1 ), 1, 0.12 );
  3205.  
  3206.  Iso surface contour the X axis of trivariate ThreeCyls and use
  3207.  the trivariate to get better normal's estimations.  Cell size is unit
  3208.  cube like, no skipping of data and iso surface level is 0.12.
  3209. $
  3210.  
  3211. NIL
  3212.  
  3213.  ListType NIL()
  3214.  
  3215.    Creates an empty list so data can be accumulated in it.
  3216.  See CINFLECT or CZEROS for examples. See also LIST and SNOC.
  3217. $
  3218.  
  3219. OFFSET
  3220.  
  3221.  PolygonType OFFSET( PolygonType Poly, NumericType OffsetDistance,
  3222.                      NumericType Tolerance, NumericType BezInterp )
  3223.  
  3224.  or
  3225.  
  3226.  CurveType OFFSET( CurveType Crv, NumericType OffsetDistance,
  3227.                    NumericType Tolerance, NumericType BezInterp )
  3228.  
  3229.  or
  3230.  
  3231.  SurfaceType OFFSET( SurfaceType Srf, NumericType OffsetDistance,
  3232.                      NumericType Tolerance, NumericType BezInterp )
  3233.  
  3234.  or
  3235.  
  3236.  TrimSrfType OFFSET( TrimSrfType TrimSrf, NumericType OffsetDistance,
  3237.                      NumericType Tolerance, NumericType BezInterp )
  3238.  
  3239.  Offsets Poly, Crv, Srf or a TrimSrf, by translating
  3240.  all the (control) points in the direction of the normal of the poly/curve
  3241.  or of the (trimmed) surface by an OffsetDistance amount.
  3242.    For a Poly object, result is an offset of the original polygon/line
  3243.  in the XY plane and is exact. Hence, Tolerance and BezInterp
  3244.  parameters are ignored.  Result is a mitter joint based offset.
  3245.    Otherwise, each control point has a node parameter value associated with
  3246.  it, which is used to compute the normal. The returned curve or surface only
  3247.  approximates the real offset. If the resulting approximation does not satisfy
  3248.  the accuracy required by Tolerance, Crv or Srf or
  3249.  TrimSrf is subdivided and an offset approximation fit is computed to
  3250.  the two halfs. For curves, one can request a Bezier interpolation scheme in
  3251.  the offset approximation by setting BezInterp. The BezInterp is
  3252.  not supported yet for (trimmed) surfaces.
  3253.  Negative OffsetDistance denotes offset in the reversed direction of the
  3254.  normal.
  3255.  
  3256.  Example:
  3257.  
  3258.     OffCrv = OFFSET( Crv, -0.4, 0.1, off );
  3259.  
  3260.  offsets Crv by the amount of -0.4 in the reversed normal direction,
  3261.  Tolerance of 0.1 and no Bezier interpolation.
  3262.  See also AOFFSET and LOFFSET.
  3263. $
  3264.  
  3265. ORTHOTOMC
  3266.  
  3267.  CurveType ORTHOTOMC( CurveType Crv, PointType Pt, NumericType K )
  3268.  
  3269.  or,
  3270.  
  3271.  SurfaceType ORTHOTOMC( SurfaceType Srf, PointType Pt, NumericType K )
  3272.  
  3273.  Computes the K-orthotomic of freeform curves and surfaces.  See
  3274.  Fundamentals of Computer Aided Geometric Design, by J. Hoschek and and
  3275.  D. Lasser.  
  3276.  
  3277.  Example:
  3278.  
  3279.     pt = point( 0, 0.35, 0 );
  3280.     crv = cbezier( list( ctlpt( E2, -0.8, -0.6 ),
  3281.                          ctlpt( E2, -0.3, -0.2 ),
  3282.                          ctlpt( E2,  0.0,  0.0 ),
  3283.                          ctlpt( E2,  0.8, -0.6 ) ) );
  3284.     Orth = ORTHOTOMC( crv, pt, 2 );
  3285.     interact( list( Orth, crv, pt ) * tx( 0.5 ) ) );
  3286.  
  3287.  computes the orthotomic of a cubic Bezier curve that has an inflection
  3288.  point.  Note inflection points are reduced to cusps in the orthotomic
  3289.  result.
  3290. $
  3291.  
  3292. PCIRCLE
  3293.  
  3294.  CurveType PCIRCLE( VectorType Center, NumericType Radius )
  3295.  
  3296.  Same as CIRCLE but approximates the circle as a polynomial curve.
  3297.  See CIRCLE.
  3298. $
  3299.  
  3300. PDECIMATE
  3301.  
  3302.  PolygonType PDECIMATE( PolygonType Obj, NumericType Dist,
  3303.                         NumericType NumPasses, NumericType DecimRatio,
  3304.                         NumericType MinAspRatio )
  3305.  
  3306.  Given a polygonal model, Obj, decimate and merge polygons, effectively
  3307.  reducing the size of the data subject to a maximal deviation distance
  3308.  Dist, number of reduction passes NumPasses, maximal number
  3309.  of DecimRatio of reductions per vertex, and aspect ratio of the
  3310.  triangulation, MinAspRatio.
  3311.  
  3312.  
  3313.  Example:
  3314.  
  3315.     gcross = cbspline( 3,
  3316.                        list( ctlpt( E3, 0.3, 0.0, 0.0 ),
  3317.                              ctlpt( E3, 0.1, 0.0, 0.1 ),
  3318.                              ctlpt( E3, 0.1, 0.0, 0.4 ),
  3319.                              ctlpt( E3, 0.5, 0.0, 0.5 ),
  3320.                              ctlpt( E3, 0.6, 0.0, 0.8 ) ),
  3321.                        list( KV_OPEN ) );
  3322.     resolution = 30;
  3323.     glass = surfprev( gcross );
  3324.     
  3325.     pglass = gpolygon( glass, false );
  3326.     
  3327.     dglass = PDECIMATE( pglass, 0.005, 3, 1, 0 );
  3328.  
  3329.  creates a surface of a glass, approximate it with polygons and then
  3330.  decimates the latter.
  3331. $
  3332.  
  3333. PDOMAIN
  3334.  
  3335.  ListType PDOMAIN( CurveType Crv )
  3336.  
  3337.  or
  3338.  
  3339.  ListType PDOMAIN( SurfaceType Srf )
  3340.  
  3341.  or
  3342.  
  3343.  ListType PDOMAIN( TriSrfType Srf )
  3344.  
  3345.  or
  3346.  
  3347.  ListType PDOMAIN( TrimSrfType TrimSrf )
  3348.  
  3349.  or
  3350.  
  3351.  ListType PDOMAIN( TrivarType TV )
  3352.  
  3353.    Returns the parametric domain of the curve (TMin, TMax) or of a (trimmed)
  3354.  surface (UMin, UMax, VMin, VMax) or of a triangular surface or trivariate
  3355.  function (UMin, UMax, VMin, VMax, WMin, WMax) as a list object.
  3356.  
  3357.  Example:
  3358.  
  3359.  circ_domain = PDOMAIN( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );
  3360. $
  3361.  
  3362. PLN3PTS
  3363.  
  3364.  PlaneType PLN3PTS( PointType Pt1, PointType Pt2, PointType Pt3 )
  3365.  
  3366.    Computes a plane out of three points.
  3367.  
  3368.  Example:
  3369.  
  3370.  Pl1 = PLN3PTS( point( 0, 0, 0 ), point( 0, 1, 0 ), point( 1, 0, 0 ) );
  3371. $
  3372.  
  3373. POLY
  3374.  
  3375.  PolygonType POLY( ListType VrtxList, NumericType IsPolyline )
  3376.  
  3377.    Creates a single polygon/polyline (and therefore open) object, defined by
  3378.  the vertices in VrtxList (see LIST). All elements in VrtxList
  3379.  must be of VectorType type. If IsPolyline, a polyline is created,
  3380.  otherwise a polygon.
  3381.  
  3382.  Example:
  3383.  
  3384.     V1  = vector( 0.0, 0.0, 0.0 );
  3385.     V2  = vector( 0.3, 0.0, 0.0 );
  3386.     V3  = vector( 0.3, 0.0, 0.1 );
  3387.     V4  = vector( 0.2, 0.0, 0.1 );
  3388.     V5  = vector( 0.2, 0.0, 0.5 );
  3389.     V6  = vector( 0.3, 0.0, 0.5 );
  3390.     V7  = vector( 0.3, 0.0, 0.6 );
  3391.     V8  = vector( 0.0, 0.0, 0.6 );
  3392.     V9  = vector( 0.0, 0.0, 0.5 );
  3393.     V10 = vector( 0.1, 0.0, 0.5 );
  3394.     V11 = vector( 0.1, 0.0, 0.1 );
  3395.     V12 = vector( 0.0, 0.0, 0.1 );
  3396.     I = POLY( list( V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12 ),
  3397.               FALSE );
  3398.  
  3399.  constructs an object with a single polygon in the shape of the letter I.
  3400. $
  3401.  
  3402. PRISA
  3403.  
  3404.  ListType PRISA( SurfaceType Srfs, NumericType SamplesPerCurve,
  3405.                  NumericType Epsilon, ConstantType Dir, VectorType Space )
  3406.  
  3407.    Computes a layout (prisa) of the given surface(s) Srfs, and returns
  3408.  a list of surface objects representing the layout.
  3409.    The surface is approximated to within Epsilon in direction Dir
  3410.  into a set of ruled surfaces and then developable surfaces that are laid out
  3411.  flat onto the XY plane. If Epsilon is negative, the piecewise ruled
  3412.  surface approximation in 3-space is returned. 
  3413.    SamplesPerCurve controls the piecewise linear approximation of the
  3414.  boundary of the ruled/developable surfaces. Space is a vector whose
  3415.  X component controls the space between the different surfaces' layout, and
  3416.  whose Y component controls the space between different layout pieces.
  3417.  
  3418.  Example:
  3419.  
  3420.  cross = cbspline( 3,
  3421.                    list( ctlpt( E3, 0.7, 0.0, 0. ),
  3422.                          ctlpt( E3, 0.7, 0.0, 0.06 ),
  3423.                          ctlpt( E3, 0.1, 0.0, 0.1 ),
  3424.                          ctlpt( E3, 0.1, 0.0, 0.6 ),
  3425.                          ctlpt( E3, 0.6, 0.0, 0.6 ),
  3426.                          ctlpt( E3, 0.8, 0.0, 0.8 ),
  3427.                          ctlpt( E3, 0.8, 0.0, 1.4 ),
  3428.                          ctlpt( E3, 0.6, 0.0, 1.6 ) ),
  3429.                    list( KV_OPEN ) );
  3430.  wglass = surfrev( cross );
  3431.  wgl_ruled = PRISA( wglass, 6, -0.1, COL, vector( 0, 0.25, 0.0 ) );
  3432.  wgl_prisa = PRISA( wglass, 6, 0.1, COL, vector( 0, 0.25, 0.0 ) );
  3433.  
  3434.  Computes a layout of a wine glass in wgl_prisa and a three-dimensional
  3435.  ruled surface approximation of wglass in wgl_ruled.
  3436. $
  3437.  
  3438. PT3BARY
  3439.  
  3440.  VectorType PT3BARY( PointType Pt1, PointType Pt2, PointType Pt3,
  3441.                      PointType InteriorPt )
  3442.  
  3443.    Computes the barycentric coordinates of InterPt with respect
  3444.  to the triangle defined by Pt1, Pt2, Pt3.  Returned
  3445.  is a vector of three coefficents, which are the weights of the three
  3446.  points of the triangle. InteriorPt is assumed to be in the
  3447.  triangle.
  3448.  
  3449.  Example:
  3450.  
  3451.  Coeffs = PT3BARY( point( 0, 0, 0 ),
  3452.                    point( 1, 0, 0 ),
  3453.                    point( 0, 1, 0 ),
  3454.                    point( 0.25, 0.25, 0.0 ) );
  3455. $
  3456.  
  3457. PTHMSPR
  3458.  
  3459.  ListType PTHMSPR( NumericType Size )
  3460.  
  3461.  Computes a fairly uniform distribution of points on a hemisphere.
  3462.  Size hints on the distance between adjacent placed points.
  3463.  
  3464.  Example:
  3465.  
  3466.  Pts = PTHMSPR( 0.1 );
  3467. $
  3468.  
  3469. PTLNPLN
  3470.  
  3471.  VectorType PTLNPLN( PointType LineOrig, VectorType LineRay, PlaneType Plane )
  3472.  
  3473.    Computes the point of intersection of given line LineOrig,
  3474.  LineRay with plane Plane.
  3475.  
  3476.  Example:
  3477.  
  3478.  InterPt = PtLnPln( point( 1, 0, 1 ), vector( 1, 1, 1 ), Plane( 0, 0, 1, 0 ) );
  3479. $
  3480.  
  3481. PTPTLN
  3482.  
  3483.  VectorType PTPTLN( PointType Point, PointType LineOrig, VectorType LineRay )
  3484.  
  3485.    Computes the point on line LineOrig, LineRay that is closest
  3486.  to point Point.  See also DSTPTLN
  3487.  
  3488.  Example:
  3489.  
  3490.  ClosestPt = PTPTLN( point( 0, 0, 0 ), point( 1, 1, 0 ), vector( 1, 1, 1 ) );
  3491.  
  3492. $
  3493.  
  3494. PTSLNLN
  3495.  
  3496.  ListType PTSLNLN( PointType Line1Orig, VectorType Line1Ray,
  3497.                    PointType Line2Orig, VectorType Line2Ray )
  3498.  
  3499.    Computes the closest two points on the two lines defined by point
  3500.  LineiOrig and ray LineiRay. See also DSTLNLN.  Returned
  3501.  is a list object with the two points.
  3502.  
  3503.  Example:
  3504.  
  3505.  ClosestPts = PtsLnLn( point( 1, 0, 0 ), vector( 0, 1, 0 ),
  3506.                        point( 0, 1, 0 ), vector( 1, 0, 0 ) );
  3507. $
  3508.  
  3509. RULEDSRF
  3510.  
  3511.  SurfaceType RULEDSRF( CurveType Crv1, CurveType Crv2 )
  3512.  
  3513.  or
  3514.  
  3515.  PolygonType RULEDSRF( PolygonType Poly1, PolygonType Poly22 )
  3516.  
  3517.    Constructs a ruled surface between the two curves Crv1 and Crv2
  3518.  or two polylines Poly1 and Poly2.
  3519.    The curves do not have to have the same order or type, and will be promoted
  3520.  to their least common denominator.  The polys must have the same number of
  3521.  points and both must be either polygons or polylines.
  3522.  
  3523.  Example:
  3524.  
  3525.     c1 = cbspline( 3,
  3526.                  list( ctlpt(E3, 1.7, 0.0 , 0  ),
  3527.                        ctlpt(E3, 0.7, 0.7 , 0  ),
  3528.                        ctlpt(E3, 1.7, 0.3 , 0  ),
  3529.                        ctlpt(E3, 1.5, 0.8 , 0  ),
  3530.                        ctlpt(E3, 1.6, 1.0 , 0  ) ),
  3531.             list( KV_OPEN ) );
  3532.     c2 = cbspline( 3,
  3533.                  list( ctlpt(E3, 0.7, 0.0 , 0  ),
  3534.                        ctlpt(E3,-0.7, 0.2 , 0  ),
  3535.                        ctlpt(E3, 0.7, 0.5 , 0  ),
  3536.                        ctlpt(E3,-0.7, 0.7 , 0  ),
  3537.                        ctlpt(E3, 0.7, 1.0 , 0  ) ) ,
  3538.             list( KV_OPEN ) );
  3539.     
  3540.     srf1 = RULEDSRF( c1, c2 );
  3541.     interact( list( c1, c2, srf1 ), on );
  3542.     
  3543.     c2a = ffmatch( c1, c2, 50, 100, 2, false, 1 );
  3544.     srf2 = RULEDSRF( c1, c2a );
  3545.     interact( list( c1, c2, srf2 ), on );
  3546.  
  3547.  Constructs a planar ruled surface between two curves, c1 and c2.
  3548.  The naive construction causes self intersection, but by employing FFMATCH
  3549.  the self intersection can be resloved.
  3550.  
  3551.  See also FFMATCH.
  3552. $
  3553.  
  3554. SBEZIER
  3555.  
  3556.  SurfaceType SBEZIER( ListType CtlMesh )
  3557.  
  3558.    Creates a Bezier surface using the provided control mesh. CtlMesh is a
  3559.  list of rows, each of which is a list of control points. All control points
  3560.  must be of type (E1-E5, P1-P5), or regular PointType defining the surface's
  3561.  control polygon. Surface's point type will be of a space which is the union
  3562.  of the spaces of all points.
  3563.  
  3564.  Example:
  3565.  
  3566.    Srf = SBEZIER( list ( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
  3567.                                ctlpt( E3, 0.0, 1.0, 0.0 ),
  3568.                                ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  3569.                          list( ctlpt( E3, 1.0, 0.0, 0.0 ),
  3570.                                ctlpt( E3, 1.0, 1.0, 2.0 ),
  3571.                                ctlpt( E3, 1.0, 2.0, 0.0 ) ),
  3572.                          list( ctlpt( E3, 2.0, 0.0, 2.0 ),
  3573.                                ctlpt( E3, 2.0, 1.0, 0.0 ),
  3574.                                ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  3575.                          list( ctlpt( E3, 3.0, 0.0, 0.0 ),
  3576.                                ctlpt( E3, 3.0, 1.0, 2.0 ),
  3577.                                ctlpt( E3, 3.0, 2.0, 0.0 ) ),
  3578.                          list( ctlpt( E3, 4.0, 0.0, 1.0 ),
  3579.                                ctlpt( E3, 4.0, 1.0, 0.0 ),
  3580.                                ctlpt( E3, 4.0, 2.0, 1.0 ) ) ) );
  3581. $
  3582.  
  3583. SBISECTOR
  3584.  
  3585.  SurfaceType SBISECTOR( SurfaceType Srf, PointType Pt )
  3586.  
  3587.     Computes the bisector surface of a given surface a a point.
  3588.  See also CBISECTOR.
  3589.  
  3590.  Example:
  3591.  
  3592.     s = ruledSrf( ctlpt( E3, -1.0, -1.0, 0.0 ) + ctlpt( E3,  1.0, -1.0, 0.0 ),
  3593.                   ctlpt( E3, -1.0,  1.0, 0.0 ) + ctlpt( E3,  1.0,  1.0, 0.0 ) );
  3594.     
  3595.     pt = point( 0.0, 0.0, 1.0 );
  3596.     
  3597.     bisect = SBISECTOR( s, pt );
  3598.  
  3599.     interact( list( s, pt, bisect ) );
  3600.  
  3601.  computes the bisector surface of a plane and a point.
  3602. $
  3603.  
  3604. SBSPLINE
  3605.  
  3606.  SurfaceType SBSPLINE( NumericType UOrder, NumericType VOrder,
  3607.                        ListType CtlMesh, ListType KnotVectors )
  3608.  
  3609.    Creates a Bspline surface from the provided UOrder and VOrder
  3610.  orders, the control mesh CtlMesh, and the two knot vectors KnotVectors.
  3611.  CtlMesh is a list of rows, each of which is a list of control points.
  3612.  All control points must be of point type (E1-E5, P1-P5), or regular
  3613.  PointType defining the surface's control mesh. Surface's point type will
  3614.  be of a space which is the union of the spaces of all points.
  3615.    KnotVectors is a list of two knot vectors. Each knot vector is a
  3616.  list of NumericType knots of length #CtlPtList plus the Order.
  3617.  If, however, the length of the knot vector is equal to #CtlPtList +
  3618.  Order + Order - 1} the curve is assumed periodic. 
  3619.    The knot vector may also be a list of a single constant KV_OPEN or
  3620.  KV_FLOAT or KV_PERIODIC, in which a uniform knot vector with the
  3621.  appropriate length and with open, floating or periodic end condition
  3622.  will be constructed automatically.
  3623.  
  3624.  Example:
  3625.  
  3626.     Mesh = list ( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
  3627.                         ctlpt( E3, 0.0, 1.0, 0.0 ),
  3628.                         ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  3629.                   list( ctlpt( E3, 1.0, 0.0, 0.0 ),
  3630.                         ctlpt( E3, 1.0, 1.0, 2.0 ),
  3631.                         ctlpt( E3, 1.0, 2.0, 0.0 ) ),
  3632.                   list( ctlpt( E3, 2.0, 0.0, 2.0 ),
  3633.                         ctlpt( E3, 2.0, 1.0, 0.0 ),
  3634.                         ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  3635.                   list( ctlpt( E3, 3.0, 0.0, 0.0 ),
  3636.                         ctlpt( E3, 3.0, 1.0, 2.0 ),
  3637.                         ctlpt( E3, 3.0, 2.0, 0.0 ) ),
  3638.                   list( ctlpt( E3, 4.0, 0.0, 1.0 ),
  3639.                         ctlpt( E3, 4.0, 1.0, 0.0 ),
  3640.                         ctlpt( E3, 4.0, 2.0, 1.0 ) ) );
  3641.     Srf = SBSPLINE( 3, 3, Mesh, list( list( KV_OPEN ),
  3642.                                       list( 3, 3, 3, 4, 5, 6, 6, 6 ) ) );
  3643.  
  3644.  constructs a bi-quadratic Bspline surface with its first knot vector
  3645.  having uniform knot spacing with open end conditions.
  3646. $
  3647.  
  3648. SCRVTR
  3649.  
  3650.  SurfaceType SCRVTR( SurfaceType Srf, ConstType PtType, ConstType Dir )
  3651.  
  3652.    Symbolically computes the extreme curvature bound on Srf.
  3653.    If Dir is either ROW or COL, then the normal curvature square
  3654.  of Srf in Dir is computed symbolically and returned.
  3655.    Otherwise, a upper bound on the sum of the squares of the two
  3656.  principal curvatures is symbolically computed and returned.
  3657.    
  3658.    Returned value is a surface that can be evaluated to the curvature
  3659.  bound, given a UV location. The returned surface value is a scalar field
  3660.  of point type P1 (scalar rational).
  3661.    However, if PtType is one of E1, P1, E3, P3 the returned surface
  3662.  is coerced to this given type. If the types are one of E3, P3, then the
  3663.  Y and Z axes are set to be equivalent to the U and V parametric domains.
  3664.  
  3665.    This function computes the square of the normal curvature scalar
  3666.  field for surfaces as (in the U parametric direction, same for V),
  3667.                      2  
  3668.                     d S
  3669.               < n , --- >
  3670.                       2
  3671.     u               du
  3672.    k (u, v) = ------------
  3673.     n         
  3674.                  dS   ds
  3675.                < -- , -- >
  3676.                  du   du
  3677.  
  3678.  and computes the sum of the squares of the principal curvatures as,
  3679.  
  3680.   2    2  ( g11 l22 + g22 l11 - 2 g12 l12 )^2 - 2 |G| |L|
  3681.  k  + k = -----------------------------------------------
  3682.   1    2                   |G|^2 ||n||^2
  3683.  
  3684.  
  3685.  See also CCRVTR.
  3686.  
  3687.  Example:
  3688.  
  3689.  cross = cbspline( 3,
  3690.                    list( ctlpt( E2,  0.0,  0.0 ),
  3691.                          ctlpt( E2,  0.8,  0.0 ),
  3692.                          ctlpt( E2,  0.8,  0.2 ),
  3693.                          ctlpt( E2,  0.07, 1.4 ),
  3694.                          ctlpt( E2, -0.07, 1.4 ),
  3695.                          ctlpt( E2, -0.8,  0.2 ),
  3696.                          ctlpt( E2, -0.8,  0.0 ),
  3697.                          ctlpt( E2,  0.0,  0.0 ) ),
  3698.                    list( KV_OPEN ) );
  3699.  cross = coerce( cross, e3 );
  3700.  s = sFromCrvs( list( cross,
  3701.                       cross * trans( vector( 0.5, 0, 1 ) ),
  3702.                       cross * trans( vector( 0, 0, 2 ) ) ), 3 );
  3703.  view( list( s, axes ), on );
  3704.  
  3705.  UCrvtrZXY = scrvtr( s, E3, row );
  3706.  VCrvtrZXY = scrvtr( s, E3, col );
  3707.  UCrvtrXYZ = UCrvtrZXY * rotx( -90 ) * roty( -90 ) * scale( vector( 1, 1, 0.001 ) );
  3708.  VCrvtrXYZ = VCrvtrZXY * rotx( -90 ) * roty( -90 ) * scale( vector( 1, 1, 10 ) );
  3709.  color( UCrvtrXYZ, red );
  3710.  color( VCrvtrXYZ, magenta );
  3711.  
  3712.  view( list( UCrvtrXYZ, VCrvtrXYZ ), off );
  3713.  
  3714.  CrvtrZXY = scrvtr( s, E3, off );
  3715.  CrvtrXYZ = CrvtrZXY * rotx( -90 ) * roty( -90 ) * scale( vector( 1, 1, 0.001 ) );
  3716.  color( CrvtrXYZ, green );
  3717.  
  3718.  view( CrvtrXYZ, off );
  3719.  
  3720.  Computes the sqaure of the normal curvature in the U and V direction, flips
  3721.  its scalar value from X to Z using rotations and scale the fields to
  3722.  reasonable values and display them.
  3723.    Then, display a total bound on the normal curvature as well.
  3724.  
  3725.  Due to the large degree of the resulting fields be warned that rational
  3726.  surfaces will compute into large degree curvature bound fields. See also
  3727.  IRITSTATE("InterpProd", FALSE); for faster symbolic computation.
  3728. $
  3729.  
  3730. SDERIVE
  3731.  
  3732.  SurfaceType SDERIVE( SurfaceType Srf, NumericType Dir )
  3733.  
  3734.    Returns a vector field surface representing the differentiated surface
  3735.  in the given direction (ROW or COL). Evaluation of the returned surface at
  3736.  a given parameter value will return a vector tangent to Srf in
  3737.  Dir at that parameter value.
  3738.  
  3739.  DuSrf = SDERIVE( Srf, ROW );
  3740.  DvSrf = SDERIVE( Srf, COL );
  3741.  Normal = coerce( seval( DuSrf, 0.5, 0.5 ), VECTOR_TYPE ) ^
  3742.           coerce( seval( DvSrf, 0.5, 0.5 ), VECTOR_TYPE );
  3743.  
  3744.  computes the two partial derivatives of the surface Srf and computes
  3745.  its normal as their cross product, at the parametric location (0.5, 0.5).
  3746. $
  3747.  
  3748. SDIVIDE
  3749.  
  3750.  SurfaceType SDIVIDE( SurfaceType Srf, ConstantType Direction,
  3751.                                                           NumericType Param )
  3752.  
  3753.  or
  3754.  
  3755.  TrimSrfType SDIVIDE( TrimSrfType Srf, ConstantType Direction,
  3756.                                                           NumericType Param )
  3757.  
  3758.    Subdivides a (possibly trimmed) surface into two at the specified parameter
  3759.  value Param in the specified Direction (ROW or COL). Srf
  3760.  can be either a Bspline surface in which Param must be conatined in
  3761.  the parametric domain of the surface, or a Bezier surface in which  Param} must be in the range of zero to one.
  3762.  
  3763.    It returns a list of upto two sub-surfaces. The individual surfaces may be
  3764.  extracted from the list using the NTH command. If Srf is a trimmed
  3765.  surface, it can be the case that one of the two subdivided surfaces is
  3766.  completely trimmed out, and hence only one surface will be returned.
  3767.  
  3768.  Example:
  3769.  
  3770.     SrfLst = SDIVIDE( Srf, ROW, 0.5 );
  3771.     Srf1 = nth( SrfLst, 1 );
  3772.     Srf2 = nth( SrfLst, 2 );
  3773.  
  3774.  Subdivides Srf at the parameter value of 0.5 in the ROW direction.
  3775. $
  3776.  
  3777. SEDITPT
  3778.  
  3779.  SurfaceType SEDITPT( SurfaceType Srf, CtlPtType CPt, NumericType UIndex,
  3780.                                                       NumericType VIndex )
  3781.  
  3782.    Provides a simple mechanism to manually modify a single control point number
  3783.  UIndex and VIndex (base count is 0) in the control mesh of Srf
  3784.  by substituting CtlPt instead. CtlPt must have the same point type as
  3785.  the control points of Srf. Original surface Srf is not modified.
  3786.  
  3787.  Example:
  3788.  
  3789.     CPt = ctlpt( E3, 1, 2, 3 );
  3790.     NewSrf = SEDITPT( Srf, CPt, 0, 0 );
  3791.  
  3792.  Constructs a NewSrf with the first control point of Srf being
  3793.  CPt.
  3794. $
  3795.  
  3796. SEVAL
  3797.  
  3798.  CtlPtType SEVAL( SurfaceType Srf, NumericType UParam, NumericType VParam )
  3799.  
  3800.  or
  3801.  
  3802.  CtlPtType SEVAL( TrimSrfType Srf, NumericType UParam, NumericType VParam )
  3803.  
  3804.    Evaluates the provided (possibly trimmed) surface Srf at the given
  3805.  UParam and VParam parameters. Both UParam and VParam
  3806.  should be contained in the surface parametric domain if Srf is a
  3807.  Bspline surface, or between zero and one if Srf is a Bezier surface.
  3808.  The returned control point has the same type as the control points of
  3809.  Srf.
  3810.  
  3811.  Example:
  3812.  
  3813.     CPt = SEVAL( Srf, 0.25, 0.22 );
  3814.  
  3815.  Evaluates Srf at the parameter values of (0.25, 0.22).
  3816. $
  3817.  
  3818. SFOCAL
  3819.  
  3820.  SurfaceType SFOCAL( SurfaceType Srf, NumericType Dir )
  3821.  
  3822.    Evaluates the focal surface field of surface Srf using the normal
  3823.  curvature in the isoparametric direction as given by Dir (either
  3824.  ROW or COL). Note this function is not using the principal curvatures as
  3825.  is generaly the case for focal surfaces.
  3826.  
  3827.  Example:
  3828.  
  3829.     gcross = cbspline( 3,
  3830.                        list( ctlpt( E3, 0.3, 0.0, 0.0 ),
  3831.                              ctlpt( E3, 0.1, 0.0, 0.1 ),
  3832.                              ctlpt( E3, 0.1, 0.0, 0.4 ),
  3833.                              ctlpt( E3, 0.5, 0.0, 0.5 ),
  3834.                              ctlpt( E3, 0.6, 0.0, 0.8 ) ),
  3835.                        list( KV_OPEN ) );
  3836.     glass = surfprev( gcross );
  3837.     color( glass, red );
  3838.     
  3839.     gfocal = SFOCAL(glass, col);
  3840.  
  3841.  Evaluates the focal surface using the COL isoparametric direction's
  3842.  normal curvature of the glass surface.
  3843. $
  3844.  
  3845. SFROMCRVS
  3846.  
  3847.  SurfaceType SFROMCRVS( ListType CrvList, NumericType OtherOrder )
  3848.  
  3849.    Constructs a surface by substituting the curves in CrvList as rows
  3850.  in a control mesh of a surface. Curves in CrvList are made compatible
  3851.  by promoting Bezier curves to Bsplines if necessary, and raising degree
  3852.  and refining as required before substituting the control polygons of the
  3853.  curves as rows in the mesh. The other direction order is set by
  3854.  OtherOrder, which cannot be larger than the number of curves.
  3855.  
  3856.    The surface interpolates the first and last curves only.
  3857.  
  3858.  Example:
  3859.  
  3860.     Crv1 = cbspline( 3,
  3861.                      list( ctlpt( E3, 0.0, 0.0, 0.0 ),
  3862.                            ctlpt( E3, 1.0, 0.0, 0.0 ),
  3863.                            ctlpt( E3, 1.0, 1.0, 0.0 ) ),
  3864.                      list( KV_OPEN ) );
  3865.     Crv2 = Crv1 * trans( vector( 0.0, 0.0, 1.0 ) );
  3866.     Crv3 = Crv2 * trans( vector( 0.0, 1.0, 0.0 ) );
  3867.     Srf = SFROMCRVS( list( Crv1, Crv2, Crv3 ), 3 );
  3868. $
  3869.  
  3870. SGAUSS
  3871.  
  3872.  SurfaceType SGAUSS( SurfaceType Srf )
  3873.  
  3874.    Evaluates the Gaussian curvature field of surface Srf.
  3875.  
  3876.  Example:
  3877.  
  3878.     Srf1 = hermite( cbezier( list( ctlpt( E3, 0.0, 0.0, 0.0 ),
  3879.                                    ctlpt( E3, 0.5, 0.2, 0.0 ),
  3880.                                    ctlpt( E3, 1.0, 0.0, 0.0 ) ) ),
  3881.                     cbezier( list( ctlpt( E3, 0.0, 1.0, 0.0 ),
  3882.                                    ctlpt( E3, 0.5, 0.8, 0.0 ),
  3883.                                    ctlpt( E3, 1.0, 1.0, 0.5 ) ) ),
  3884.                     cbezier( list( ctlpt( E3, 0.0, 2.0, 0.0 ),
  3885.                                    ctlpt( E3, 0.0, 2.0, 0.0 ),
  3886.                                    ctlpt( E3, 0.0, 2.0, 0.0 ) ) ),
  3887.                     cbezier( list( ctlpt( E3, 0.0, 2.0, 0.0 ),
  3888.                                    ctlpt( E3, 0.0, 2.0, 0.0 ),
  3889.                                    ctlpt( E3, 0.0, 2.0, 0.0 ) ) ) );
  3890.  
  3891.     SGauss = SGAUSS( Srf1 );
  3892.  
  3893.  Evaluates the Gaussian curvaure of Srf1.
  3894. $
  3895.  
  3896. SINTERP
  3897.  
  3898.  SurfaceType SINTERP( ListType PtList, NumericType UOrder, NumericType VOrder,
  3899.                       NumericType USize, NumericType VSize,
  3900.                       ConstantType Param)
  3901.  
  3902.    Computes a Bspline polynomial surface that interpolates or approximates
  3903.  the rectangular grid or scattered set of points in PtList. The
  3904.  Bspline surface will have orders UOrder and VOrder and mesh
  3905.  of size USize by VSize control points. If the data is on a grid,
  3906.  the knots will be spaced according to Param which can be one of
  3907.  PARAM_UNIFORM, PARAM_CHORD or PARAM_CENTRIP.  The former prescribed a
  3908.  uniform knot sequence and the latters specified a knot spacing according
  3909.  to the chord length and a square root of the chord length. Currently only
  3910.  PARAM_UNIFORM is supported. For scattered point set, the Param
  3911.  parameter is ignored.
  3912.    PtList is a list of list of points for girdded data where all
  3913.  lists should carry the same amount of points in them, defining a
  3914.  rectangular grid.  For scattered data, PtList is a linear list
  3915.  of points. All points in PtList must be of type (E1-E5, P1-P5)
  3916.  control point, or regular PointType.  If USize and VSize
  3917.  are equal to the number of points in the grid data set of PtList,
  3918.  the resulting surface will interpolate the data set. Otherwise,
  3919.  if USize or VSize is less than the number of points in
  3920.  the grid of PtList, the point data set will be least square
  3921.  approximated.  In no time can USize or VSize be larger that the
  3922.  number of points in PtList or lower than UOrder and VOrder,
  3923.  respectively. If USize or VSize are zero, the grid size
  3924.  is used, forcing an interpolation of the data set.
  3925.    If PtList contains a linear list of points, these points are
  3926.  treated as scattered.  Each scattered point is assumed to be holding the
  3927.  parameteric location to interpolate at as its first two coefficients.
  3928.  The other coefficients are the interpolation values.  In other words,
  3929.  to interpolated scattered data of type E3, E5 control points in a linear
  3930.  list must be provided in (u, v, x, y, z) format.  Scattered data is
  3931.  interpolated over a unit square (0 to 1) parameteric domain in both u
  3932.  and v.
  3933.   
  3934.    All interior knots will be distinct preserving maximal continuity.
  3935.  The resulting Bspline surface will have open end conditions.
  3936.  
  3937.  Example:
  3938.  
  3939.     pl = nil();
  3940.     pll = nil();
  3941.     for ( x = -5, 1, 5,
  3942.           pl = nil():
  3943.           for ( y = -5, 1, 5,
  3944.                 snoc( point( x, y, sin( x * Pi / 2 ) * cos( y * Pi / 2 ) ),
  3945.                       pl )
  3946.           ):
  3947.           snoc( pl, pll ) );
  3948.  
  3949.     s1 = sinterp( pll, 3, 3, 8, 8, PARAM_UNIFORM );
  3950.     s2 = sinterp( pll, 3, 3, 11, 11, PARAM_UNIFORM );
  3951.  
  3952.  Samples an explicit surface sin(x) * cos(y) at a grid of 11 by 11 points,
  3953.  least square fit with a grid of size of 8 by 8 surface s1, and
  3954.  interpolate surface s2 using this data set.
  3955. $
  3956.  
  3957. SMEANSQR
  3958.  
  3959.  SurfaceType SMEANSQR( SurfaceType Srf )
  3960.  
  3961.    Evaluates the square of the mean curvature field of surface Srf.
  3962.  
  3963.  Example:
  3964.  
  3965.     Srf1 = hermite( cbezier( list( ctlpt( E3, 0.0, 0.0, 0.0 ),
  3966.                                    ctlpt( E3, 0.5, 0.2, 0.0 ),
  3967.                                    ctlpt( E3, 1.0, 0.0, 0.0 ) ) ),
  3968.                     cbezier( list( ctlpt( E3, 0.0, 1.0, 0.0 ),
  3969.                                    ctlpt( E3, 0.5, 0.8, 0.0 ),
  3970.                                    ctlpt( E3, 1.0, 1.0, 0.5 ) ) ),
  3971.                     cbezier( list( ctlpt( E3, 0.0, 2.0, 0.0 ),
  3972.                                    ctlpt( E3, 0.0, 2.0, 0.0 ),
  3973.                                    ctlpt( E3, 0.0, 2.0, 0.0 ) ) ),
  3974.                     cbezier( list( ctlpt( E3, 0.0, 2.0, 0.0 ),
  3975.                                    ctlpt( E3, 0.0, 2.0, 0.0 ),
  3976.                                    ctlpt( E3, 0.0, 2.0, 0.0 ) ) ) );
  3977.  
  3978.     SMean = SMEANSQR( Srf1 );
  3979.  
  3980.  Evaluates the square of the mean curvaure of Srf1.
  3981. $
  3982.  
  3983. SMERGE
  3984.  
  3985.  SurfaceType SMERGE( SurfaceType Srf1, SurfaceType Srf2,
  3986.                      NumericType Dir, NumericType SameEdge )
  3987.  
  3988.  Merges two surfaces along the requested direction (ROW or COL). If
  3989.  SameEdge is non-zero (ON or TRUE), then the common edge is assumed to be
  3990.  identical and copied only once. Otherwise (OFF or FALSE), a ruled surface
  3991.  is constructed between the two surfaces along the (not) common edge.
  3992.  
  3993.  Example:
  3994.  
  3995.  MergedSrf = SMERGE( Srf1, Srf2, ROW, TRUE );
  3996. $
  3997.  
  3998. SMORPH
  3999.  
  4000.  SurfaceType SMORPH( SurfaceType Srf1, SurfaceType Srf2, NumericType Blend )
  4001.  
  4002.  Creates a new surface which is a convex blend of the two given surfaces.
  4003.  The two given surfaces must be compatible (see FFCOMPAT) before this blend
  4004.  is invoked. Very useful if a sequence that "morphs" one surface to another
  4005.  is to be created.
  4006.  
  4007.  Example:
  4008.  
  4009.  for ( i = 0.0, 1.0, 11.0,
  4010.         Msrf = SMORPH( Srf1, Srf2, i / 11.0 ):
  4011.         color( Msrf, white ):
  4012.         attrib( Msrf, "rgb", "255,255,255" ):
  4013.         attrib( Msrf, "reflect", "0.7" ):
  4014.         save( "morp1-" + i, Msrf )
  4015.  );
  4016.  
  4017.  creates a sequence of 12 surfaces, morphed from Srf1 to Srf2
  4018.  and saves them in the files "morph-0.dat" to "morph-11.dat".
  4019.  See also CMORPH and TMORPH.
  4020. $
  4021.  
  4022. SNORMAL
  4023.  
  4024.  VectorType SNORMAL( SurfaceType Srf, NumericType UParam, NumericType VParam )
  4025.  
  4026.  or
  4027.  
  4028.  VectorType SNORMAL( TrimSrfType Srf, NumericType UParam, NumericType VParam )
  4029.  
  4030.    Computes the normal vector to (possibly trimmed) surface Srf at the
  4031.  parameter values UParam and VParam. The returned vector has a
  4032.  unit length.
  4033.  
  4034.  Example:
  4035.  
  4036.     Normal = SNORMAL( Srf, 0.5, 0.5 );
  4037.  
  4038.  computes the normal to Srf at the parameter values (0.5, 0.5).
  4039.  See also SNRMLSRF.
  4040. $
  4041.  
  4042. SNRMLSRF
  4043.  
  4044.  SurfaceType SNRMLSRF( SurfaceType Srf )
  4045.  
  4046.  Symbolically computes a vector field surface representing the non-normalized
  4047.  normals of the given surface. That is the normal surface, evaluated at
  4048.  (u, v), provides a vector in the direction of the normal of the original
  4049.  surface at (u, v). The normal surface is computed as the symbolic cross
  4050.  product of the two surfaces representing the partial derivatives of the
  4051.  original surface.
  4052.  
  4053.  Example:
  4054.  
  4055.  NrmlSrf = SNRMLSRF( Srf );
  4056. $
  4057.  
  4058. SPHERE
  4059.  
  4060.  PolygonType SPHERE( VectorType Center, NumericType Radius )
  4061.  
  4062.    Creates a SPHERE geometric object, defined by Center as the center of
  4063.  the SPHERE, and with Radius as the radius of the SPHERE.
  4064.    See RESOLUTION for accuracy of SPHERE approximation as a polygonal model. 
  4065.    See IRITSTATE's "PrimRatSrfs" and "PrimRatSrfs" state variables.
  4066. $
  4067.  
  4068. SRAISE
  4069.  
  4070.  SurfaceType SRAISE( SurfaceType Srf, ConstantType Direction,
  4071.                                                       NumericType NewOrder )
  4072.  
  4073.    Raises Srf to the specified NewOrder in the specified
  4074.  Direction.
  4075.  
  4076.  Example:
  4077.  
  4078.     Srf = ruledSrf( cbezier( list( ctlpt( E3, -0.5, -0.5, 0.0 ),
  4079.                                    ctlpt( E3,  0.5, -0.5, 0.0 ) ) ),
  4080.                     cbezier( list( ctlpt( E3, -0.5,  0.5, 0.0 ),
  4081.                                    ctlpt( E3,  0.5,  0.5, 0.0 ) ) ) );
  4082.     Srf = SRAISE( SRAISE( Srf, ROW, 3 ), COL, 3 );
  4083.  
  4084.  constructs a bilinear flat ruled surface and raises both its directions to be
  4085.  a bi-quadratic surface.
  4086. $
  4087.  
  4088. SREFINE
  4089.  
  4090.  SurfaceType SREFINE( SurfaceType Srf, ConstantType Direction,
  4091.                       NumericType Replace, ListType KnotList )
  4092.  
  4093.    Provides the ability to Replace a knot vector of Srf or refine 
  4094.  it in the specified direction Direction (ROW or COL).
  4095.    KnotList is a list of knots to refine Srf at. All knots should be
  4096.  contained in the parametric domain of Srf in Direction. If the knot
  4097.  vector is replaced, the length of KnotList should be identical to the
  4098.  length of the original knot vector of Srf in Direction. If Srf
  4099.  is a Bezier surface, it is automatically promoted to be a Bspline surface.
  4100.  
  4101.  Example:
  4102.  
  4103.     Srf = SREFINE( SREFINE( Srf,
  4104.                             ROW, FALSE, list( 0.333, 0.667 ) ),
  4105.                    COL, FALSE, list( 0.333, 0.667 ) );
  4106.  
  4107.  refines Srf in both directions by adding two more knots at 0.333 and
  4108.  0.667.
  4109. $
  4110.  
  4111. SREGION
  4112.  
  4113.  SurfaceType SREGION( SurfaceType Srf, ConstantType Direction,
  4114.                                   NumericType MinParam, NumericType MaxParam )
  4115.  
  4116.    Extracts a region of Srf between MinParam and MaxParam
  4117.  in the specified Direction. Both MinParam and MaxParam
  4118.  should be contained in the parametric domain of Srf in Direction.
  4119.  
  4120.  Example:
  4121.  
  4122.     Srf = ruledSrf( cbezier( list( ctlpt( E3, -0.5, -0.5, 0.5 ),
  4123.                                    ctlpt( E3,  0.0,  0.5, 0.0 ),
  4124.                                    ctlpt( E3,  0.5, -0.5, 0.0 ) ) ),
  4125.                     cbezier( list( ctlpt( E3, -0.5,  0.5, 0.0 ),
  4126.                                    ctlpt( E3,  0.0,  0.0, 0.0 ),
  4127.                                    ctlpt( E3,  0.5,  0.5, 0.5 ) ) ) );
  4128.     SubSrf = SREGION( Srf, ROW, 0.3, 0.6 );
  4129.  
  4130.  extracts the region of Srf from the parameter value 0.3 to the
  4131.  parameter value 0.6 along the ROW direction. the COLumn direction is
  4132.  extracted as a whole.
  4133. $
  4134.  
  4135. SREPARAM
  4136.  
  4137.  SurfaceType SREPARAM( SurfaceType Srf, ConstantType Direction,
  4138.                                   NumericType MinParam, NumericType MaxParam )
  4139.  
  4140.    Reparametrize Srf over a new domain from MinParam to MaxParam,
  4141.  in the prescribed Direction. This operation does not affect the geometry
  4142.  of the surface and only affine transforms its knot vectors. A Bezier surface
  4143.  will automatically be promoted into a Bspline surface by this function.
  4144.  
  4145.  Example:
  4146.  
  4147.     srf = sbspline( 2, 4,
  4148.                      list( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
  4149.                                  ctlpt( E2, 0.0, 1.0 ),
  4150.                                  ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  4151.                            list( ctlpt( E2, 1.0, 0.0 ),
  4152.                                  ctlpt( E3, 1.0, 1.0, 2.0 ),
  4153.                                  ctlpt( E2, 1.0, 2.0 ) ),
  4154.                            list( ctlpt( E3, 2.0, 0.0, 2.0 ),
  4155.                                  ctlpt( E2, 2.0, 1.0 ),
  4156.                                  ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  4157.                            list( ctlpt( E2, 3.0, 0.0 ),
  4158.                                  ctlpt( E3, 3.0, 1.0, 2.0 ),
  4159.                                  ctlpt( E2, 3.0, 2.0 ) ),
  4160.                            list( ctlpt( E3, 4.0, 0.0, 1.0 ),
  4161.                                  ctlpt( E2, 4.0, 1.0 ),
  4162.                                  ctlpt( E3, 4.0, 2.0, 1.0 ) ) ),
  4163.                      list( list( KV_OPEN ),
  4164.                            list( KV_OPEN ) ) );
  4165.     
  4166.     srf = sreparam( sreparam( srf, ROW, 0, 1 ), COL, 0, 1 );
  4167.  
  4168.  Ensures that the Bspline surface is defined over the unit size parametric
  4169.  domain.
  4170. $
  4171.  
  4172. SRINTER
  4173.  
  4174.  PointType SRINTER( SurfaceType Srf, PointType RayOrigin,
  4175.                     VectorType RayDirection )
  4176.  
  4177.    Computes the first intersection, if any, of the prescribed ray originating
  4178.  from RayOrigin in direction RayDirection with surface Srf.
  4179.    Returns the intersection point in the parametric space of Srf with
  4180.  the U and V coordinates as the X and Y coefficients of the returned value.
  4181.    The intersection is computed between the ray and a polygonal approximation
  4182.  of the surface Srf as set via the RESOLUTION variable.
  4183.  
  4184.  Example:
  4185.  
  4186.     RayOrigin = point( 2, 0.1, 0.3 );
  4187.     RayDir = vector( -4, 0, 0 );
  4188.  
  4189.     RayLine = coerce( RayOrigin, E3 ) + coerce( RayOrigin + RayDir, E3 );
  4190.     color( RayLine, magenta );
  4191.     attrib( RayLine, "dwidth", 2 );
  4192.  
  4193.     resolution = 5;
  4194.     InterPt = SRINTER( glass, RayOrigin, RayDir );
  4195.     InterPtE3 = seval( glass, coord( InterPt, 0 ), coord( InterPt, 1 ) );
  4196.     color( InterPtE3, cyan );
  4197.     attrib( InterPtE3, "dwidth", 3 );
  4198.     view( list( InterPtE3, RayLine, glass, axes ), 1 );
  4199.  
  4200.     resolution = 80;
  4201.     InterPt = SRINTER( glass, RayOrigin, RayDir );
  4202.     InterPtE3 = seval( glass, coord( InterPt, 0 ), coord( InterPt, 1 ) );
  4203.     color( InterPtE3, cyan );
  4204.     attrib( InterPtE3, "dwidth", 3 );
  4205.     view( list( InterPtE3, RayLine, glass, axes ), 1 );
  4206.  
  4207.  A complete example of constructing a ray and intersecting it against a
  4208.  surface of a glass at two different resolution, resulting in two different
  4209.  accuracies. See also RESOLUTION.
  4210. $
  4211.  
  4212. STANGENT
  4213.  
  4214.  VectorType STANGENT( SurfaceType Srf, ConstantType Direction,
  4215.                       NumericType UParam, NumericType VParam )
  4216.  
  4217.  or
  4218.  
  4219.  VectorType STANGENT( TrimSrfType Srf, ConstantType Direction,
  4220.                       NumericType UParam, NumericType VParam )
  4221.  
  4222.    Computes the tangent vector to (possibly trimmed) surface Srf at the
  4223.  parameter values UParam and VParam in Direction. The
  4224.  returned vector has a unit length.
  4225.  
  4226.  Example:
  4227.  
  4228.     Tang = STANGENT( Srf, ROW, 0.5, 0.6 );
  4229.  
  4230.  computes the tangent to Srf in the ROW direction at the parameter
  4231.  values (0.5, 0.6).
  4232. $
  4233.  
  4234. STRIMSRF
  4235.  
  4236.  SurfaceType STRIMSRF( TrimSrfType TSrf )
  4237.  
  4238.    Extracts the surface of a trimmed surface TSrf.
  4239.  
  4240.  Example:
  4241.  
  4242.     Srf = STRIMSRF( TrimSrf ); 
  4243.  
  4244.  extracts the surface of TrimSrf.
  4245. $
  4246.  
  4247. STRIVAR
  4248.  
  4249.  SurfaceType STRIVAR( TrivarType TV )
  4250.  
  4251.    Extracts an iso surface from a trivariate function TV.
  4252.  
  4253.  Example:
  4254.  
  4255.     TV1 = tbezier( list( list( list( ctlpt( E3, 0.1, 0.0, 0.8 ),
  4256.                                      ctlpt( E3, 0.2, 0.1, 2.4 ) ),
  4257.                                list( ctlpt( E3, 0.3, 2.2, 0.2 ),
  4258.                                      ctlpt( E3, 0.4, 2.3, 2.0 ) ) ),
  4259.                          list( list( ctlpt( E3, 2.4, 0.8, 0.1 ),
  4260.                                      ctlpt( E3, 2.2, 0.7, 2.3 ) ),
  4261.                                list( ctlpt( E3, 2.3, 2.6, 0.5 ),
  4262.                                      ctlpt( E3, 2.1, 2.5, 2.7) ) ) ) );
  4263.     Srf = STRIVAR( TV1, col, 0.4 ); 
  4264.  
  4265.  extracts an iso surface of TV1, in the col direction at
  4266.  parameter value 0.4.
  4267. $
  4268.  
  4269. SURFPREV
  4270.  
  4271.  SurfaceType SURFPREV( CurveType Object )
  4272.  
  4273.  Same as SURFREV but approximates the surface of revolution as a
  4274.  polynomial surface. Object must be a polynomial curve.
  4275.  See SURFREV.
  4276. $
  4277.  
  4278. SURFREV
  4279.  
  4280.  PolygonType SURFREV( PolygonType Object )
  4281.  
  4282.  or
  4283.  
  4284.  SurfaceType SURFREV( CurveType Object )
  4285.  
  4286.    Creates a surface of revolution by rotating the first polygon/curve of the
  4287.  given Object, around the Z axis. Use the linear transformation function
  4288.  to position a surface of revolution in a different orientation.
  4289.  
  4290.  Example:
  4291.  
  4292.     VTailAntn = SURFREV( ctlpt( E3, 0.001, 0.0, 1.0 ) +
  4293.                          ctlpt( E3, 0.01,  0.0, 1.0 ) +
  4294.                          ctlpt( E3, 0.01,  0.0, 0.8 ) +
  4295.                          ctlpt( E3, 0.03,  0.0, 0.7 ) +
  4296.                          ctlpt( E3, 0.03,  0.0, 0.3 ) +
  4297.                          ctlpt( E3, 0.001, 0.0, 0.0 ) );
  4298.  
  4299.  constructs a piecewise linear Bspline curve in the XZ plane and uses it to
  4300.  construct a surface of revolution by rotating it around the Z axis.
  4301.    See also SURFPREV.
  4302. $
  4303.  
  4304. SVISIBLE
  4305.  
  4306.  ListType SVISIBLE( SurfaceType Srf,
  4307.                     NumericType Resolution,
  4308.                     NumericType ConeSize )
  4309.  
  4310.  Computes a decomposition of a freeform surface Srf into regions each
  4311.  visible with a cone visibility of ConeSize degrees from one direction.
  4312.  In other words all point in one region have angular deviation of their surface
  4313.  normal of less than ConeSize degrees from the set viewing direction.
  4314.  Resolution controls the accuracy of the computation; the higher this
  4315.  value is, more exact the result. 20 is a good starting value.  Each returned
  4316.  region is a trimmed surface that has a "ViewDir" attribute that contains
  4317.  the viewing direction of this region.
  4318.  
  4319.  Example:
  4320.  
  4321.     c1 = cbezier( list( ctlpt( E3, 1.0, 0.0,  0.5 ),
  4322.                         ctlpt( E3, 1.1, 0.0,  0.0 ),
  4323.                         ctlpt( E3, 1.0, 0.0, -0.5 ) ) );
  4324.     Simp = sregion( surfPRev( c1 ), col, 0.0, 1.0 ) * rz( 45 ) * rx( 90 );
  4325.     Decomp = SVISIBLE( Simp, 20, 30 * pi / 180 );
  4326.     
  4327.     SimDecomp = nil();
  4328.     Mod = 5;
  4329.     for ( i = 1, 1, sizeof( Decomp ),
  4330.         o = nth( Decomp, i ):
  4331.         v = getattr( o, "ViewDir" ):
  4332.         l = ( ctlpt( E3, 0, 0, 0 ) + coerce( v, e3 ) ) * sc( 1.5 ):
  4333.         j = floor( ( i - 1 ) / Mod ):
  4334.         snoc( list( o, Simp, l, axes )
  4335.                     * view_mat * tx( ( i - 1 - j * Mod ) * 2 - 4 )
  4336.                                * ty( -j * 2 ),
  4337.               SimDecomp ) );
  4338.  
  4339.     view( SimDecomp, on );
  4340.  
  4341.  decomposes a given surface Simp into regions of 30 degrees at most,
  4342.  goes over the decomposed regions and order them five in a row.
  4343. $
  4344.  
  4345. SWEEPSRF
  4346.  
  4347.  SurfaceType SWEEPSRF( CurveType CrossSection, CurveType Axis,
  4348.                      CurveType FrameCrv | VectorType FrameVec | ConstType OFF )
  4349.  
  4350.    Constructs a generalized cylinder surface. This function sweeps a specified
  4351.  cross-section CrossSection along the provided Axis.
  4352.    By default, when frame specification is OFF, the orientation
  4353.  of the cross section is computed using the Axis curve tangent and
  4354.  normal. However, unlike the Frenet frame, attempt is made to minimize
  4355.  the normal change, as can happen along inflection points in Axis.
  4356.    If a VectorType FrameVec is provided as a frame orientation setting,
  4357.  it is used to fix the binormal direction to this value. In other words, the
  4358.  orientation frame has a fixed binormal. If a CurveType FrameCrv is
  4359.  specified as a frame orientation setting, this vector field curve is
  4360.  evaluated at each placement of the cross-section to yield the needed binormal.
  4361.  
  4362.    The resulting sweep is only an approximation of the real sweep. The
  4363.  resulting sweep surface will not be exact, in general.
  4364.    Refinement of the axis curve at the proper location, where accuracy is
  4365.  important, should improve the accuracy of the output. The parametric domains
  4366.  of FrameCrv do not have to match the parametric domain of Axis,
  4367.  and its parametric domain is automatically made compatible by this function.
  4368.  
  4369.  Example:
  4370.  
  4371.     Cross = arc( vector( 0.2, 0.0, 0.0 ),
  4372.                  vector( 0.2, 0.2, 0.0 ),
  4373.                  vector( 0.0, 0.2, 0.0 ) ) +
  4374.             arc( vector( 0.0, 0.4, 0.0 ),
  4375.                  vector( 0.1, 0.4, 0.0 ),
  4376.                  vector( 0.1, 0.5, 0.0 ) ) +
  4377.             arc( vector( 0.8, 0.5, 0.0 ),
  4378.                  vector( 0.8, 0.3, 0.0 ),
  4379.                  vector( 1.0, 0.3, 0.0 ) ) +
  4380.             arc( vector( 1.0, 0.1, 0.0 ),
  4381.                  vector( 0.9, 0.1, 0.0 ),
  4382.                  vector( 0.9, 0.0, 0.0 ) ) +
  4383.             ctlpt( E2, 0.2, 0.0 );
  4384.     Axis = arc( vector( -1.0, 0.0, 0.0 ),
  4385.                 vector(  0.0, 0.0, 0.1 ),
  4386.                 vector(  1.0, 0.0, 0.0 ) );
  4387.     Axis = crefine( Axis, FALSE, list( 0.25, 0.5, 0.75 ) );
  4388.     Srf1 = SWEEPSRF( Cross, Axis, OFF );
  4389.     Srf2 = SWEEPSRF( Cross, Axis, vector( 0.0, 1.0, 1.0 ) );
  4390.     Srf3 = SWEEPSRF( Cross, Axis,
  4391.                      cbezier( list( ctlpt( E3,  1.0, 0.0, 0.0 ),
  4392.                                     ctlpt( E3,  0.0, 1.0, 0.0 ),
  4393.                                     ctlpt( E3, -1.0, 0.0, 0.0 ) ) ) );
  4394.  
  4395.  constructs a rounded rectangle cross-section and sweeps it along an arc,
  4396.  while orienting it several ways. The axis curve Axis is manually
  4397.  refined to better approximate the requested shape.
  4398.  
  4399.  See also SWPSCLSRF for sweep with scale.
  4400. $
  4401.  
  4402. SWPSCLSRF
  4403.  
  4404.  SurfaceType SWPSCLSRF( CurveType CrossSection, CurveType Axis,
  4405.                         NumericType Scale | CurveType ScaleCrv,
  4406.                         CurveType FrameCrv | VectorType FrameVec
  4407.                                                           | ConstType OFF,
  4408.                         NumericType ScaleRefine )
  4409.  
  4410.    Constructs a generalized cylinder surface. This function sweeps a specified
  4411.  cross-section CrossSection along the provided Axis.
  4412.  The cross-section may be scaled by a constant value Scale, or scaled
  4413.  along the Axis parametric direction via a scaling curve ScaleCrv.
  4414.    By default, when frame specification is OFF, the orientation
  4415.  of the cross section is computed using the Axis curve tangent and
  4416.  normal. However, unlike the Frenet frame, attempt is made to minimize
  4417.  the normal change, as can happen along inflection points in Axis.
  4418.    If a VectorType FrameVec is provided as a frame orientation setting,
  4419.  it is used to fix the binormal direction to this value. In other words, the
  4420.  orientation frame has a fixed binormal. If a CurveType FrameCrv is
  4421.  specified as a frame orientation setting, this vector field curve is
  4422.  evaluated at each placement of the cross-section to yield the needed binormal.
  4423.    ScaleRefine is an integer value to define possible refinement of the
  4424.  Axis to reflect the information in ScalingCrv. Value of zero will
  4425.  force no refinement while value of n > 0 will insert n times the
  4426.  number of control points in ScaleCrv into Axis, better emulating
  4427.  the scaling requested.
  4428.    The resulting sweep is only an approximation of the real sweep. The
  4429.  scaling and axis placement will not be exact, in general.
  4430.    Manual refinement (in addition to ScaleRefine) of the axis curve at
  4431.  the proper location, where accuracy is important, should improve the accuracy
  4432.  of the output. The parametric domains of ScaleCrv and FrameCrv do
  4433.  not have to match the parametric domain of Axis, and their domains are
  4434.  made compatible by this function.
  4435.  
  4436.  Example:
  4437.  
  4438.     Cross = arc( vector( -0.11, -0.1,  0.0 ),
  4439.                  vector( -0.1,  -0.1,  0.0 ),
  4440.                  vector( -0.1,  -0.11, 0.0 ) ) +
  4441.             arc( vector(  0.1,  -0.11, 0.0 ),
  4442.                  vector(  0.1,  -0.1,  0.0 ),
  4443.                  vector(  0.11, -0.1,  0.0 ) ) +
  4444.             arc( vector(  0.11,  0.1,  0.0 ),
  4445.                  vector(  0.1,   0.1,  0.0 ),
  4446.                  vector(  0.1,   0.11, 0.0 ) ) +
  4447.             arc( vector( -0.1,   0.11, 0.0 ),
  4448.                  vector( -0.1,   0.1,  0.0 ),
  4449.                  vector( -0.11,  0.1,  0.0 ) ) +
  4450.             ctlpt( E2, -0.11, -0.1 );
  4451.     scaleCrv = cbspline( 3,
  4452.                          list( ctlpt( E2, 0.05, 1.0 ),
  4453.                                ctlpt( E2, 0.1,  0.0 ),
  4454.                                ctlpt( E2, 0.2,  2.0 ),
  4455.                                ctlpt( E2, 0.3,  0.0 ),
  4456.                                ctlpt( E2, 0.4,  2.0 ),
  4457.                                ctlpt( E2, 0.5,  0.0 ),
  4458.                                ctlpt( E2, 0.6,  2.0 ),
  4459.                                ctlpt( E2, 0.7,  0.0 ),
  4460.                                ctlpt( E2, 0.8,  2.0 ),
  4461.                                ctlpt( E2, 0.85, 1.0 ) ),
  4462.                          list( KV_OPEN ) );
  4463.     Axis = circle( vector( 0, 0, 0 ), 1 );
  4464.     Frame = circle( vector( 0, 0, 0 ), 1 )
  4465.             * rotx( 90 ) * trans( vector( 1.5, 0.0, 0.0 ) );
  4466.  
  4467.     Srf1 = SWPSCLSRF( Cross, Axis, scaleCrv, off, 0 );
  4468.     Srf2 = SWPSCLSRF( Cross, Axis, scaleCrv, off, 2 );
  4469.     Srf3 = SWPSCLSRF( Cross, Axis, 1.0, Frame, 0 );
  4470.  
  4471.  constructs a rounded rectangle cross-section and sweeps it along a circle,
  4472.  while scaling and orienting in several ways. The axis curve Axis is
  4473.  automatically refined in Srf2 to better approximate the requested
  4474.  scaling.
  4475.  
  4476.  See also SWEEPSRF for sweep with no scale.
  4477. $
  4478.  
  4479. SYMBPROD
  4480.  
  4481.  CurveType SYMBPROD( CurveType Crv1, CurveType Crv2 )
  4482.  
  4483.  or
  4484.  
  4485.  SurfaceType SYMBPROD( SurfaceType Srf1, SurfaceType Srf2 )
  4486.  
  4487.  Computes the symbolic product of the given two curves or surfaces as
  4488.  a curve or surface. The product is computed coordinate-wise.
  4489.  
  4490.  Example:
  4491.  
  4492.  ProdSrf = SYMBPROD( Srf1, Srf2 )
  4493. $
  4494.  
  4495. SYMBDPROD
  4496.  
  4497.  CurveType SYMBDPROD( CurveType Crv1, CurveType Crv2 )
  4498.  
  4499.  or
  4500.  
  4501.  SurfaceType SYMBDPROD( SurfaceType Srf1, SurfaceType Srf2 )
  4502.  
  4503.  Computes the symbolic dot (inner) product of the given two curves or surfaces
  4504.  as a scalar curve or surface.
  4505.  
  4506.  Example:
  4507.  
  4508.  DiffCrv = symbdiff( Crv1, Crv2 )
  4509.  DistSqrCrv = SYMBDPROD( DiffCrv, DiffCrv )
  4510.  
  4511.  Computes a scalar curve that at parameter t is equal to the distance
  4512.  square between Crv1 at t and Crv2.
  4513. $
  4514.  
  4515. SYMBCPROD
  4516.  
  4517.  CurveType SYMBCPROD( CurveType Crv1, CurveType Crv2 )
  4518.  
  4519.  or
  4520.  
  4521.  SurfaceType SYMBCPROD( SurfaceType Srf1, SurfaceType Srf2 )
  4522.  
  4523.  Computes the symbolic cross product of the given two curves or surfaces as
  4524.  a curve or surface.
  4525.  
  4526.  Example:
  4527.  
  4528.  NrmlSrf = SYMBCPROD( sderive( Srf, ROW ), sderive( Srf, COL ) )
  4529.  
  4530.  computes a normal surface as the cross product of the surface two partial
  4531.  derivatives (see SNRMLSRF).
  4532. $
  4533.  
  4534. SYMBSUM
  4535.  
  4536.  CurveType SYMBSUM( CurveType Crv1, CurveType Crv2 )
  4537.  
  4538.  or
  4539.  
  4540.  SurfaceType SYMBSUM( SurfaceType Srf1, SurfaceType Srf2 )
  4541.  
  4542.  Computes the symbolic sum of the given two curves or surfaces as
  4543.  a curve or surface. The sum is computed coordinate-wise.
  4544.  
  4545.  Example:
  4546.  
  4547.  SumCrv = SYMBSUM( Crv1, Crv2 )
  4548. $
  4549.  
  4550. SYMBDIFF
  4551.  
  4552.  CurveType SYMBDIFF( CurveType Crv1, CurveType Crv2 )
  4553.  
  4554.  or
  4555.  
  4556.  SurfaceType SYMBDIFF( SurfaceType Srf1, SurfaceType Srf2 )
  4557.  
  4558.  Computes the symbolic difference of the given two curves or surfaces as
  4559.  a curve or surface. The difference is computed coordinate-wise.
  4560.  
  4561.  Example:
  4562.  
  4563.  DiffCrv = SYMBDIFF( Crv1, Crv2 )
  4564.  DistSqrCrv = symbdprod( DiffCrv, DiffCrv )
  4565. $
  4566.  
  4567. TBEZIER
  4568.  
  4569.  TrivarType TBEZIER( ListType CtlMesh )
  4570.  
  4571.    Creates a Bezier trivariate using the provided control mesh. CtlMesh
  4572.  is a list of planes, each of which is a list of rows, each of which is a list
  4573.  of control points. All control points must be of type (E1-E5, P1-P5), or
  4574.  regular PointType defining the trivariate's control mesh. Surface's point
  4575.  type will be of a space which is the union of the spaces of all points.
  4576.  
  4577.  Example:
  4578.  
  4579.    TV = TBEZIER( list( list( list( ctlpt( E3, 0.1, 0.1, 0.0 ),
  4580.                                    ctlpt( E3, 0.2, 0.5, 1.1 ),
  4581.                                    ctlpt( E3, 0.3, 0.1, 2.2 ) ),
  4582.                              list( ctlpt( E3, 0.4, 1.3, 0.5 ),
  4583.                                    ctlpt( E3, 0.5, 1.7, 1.7 ),
  4584.                                    ctlpt( E3, 0.6, 1.3, 2.9 ) ),
  4585.                              list( ctlpt( E3, 0.7, 2.4, 0.5 ),
  4586.                                    ctlpt( E3, 0.8, 2.6, 1.4 ),
  4587.                                    ctlpt( E3, 0.9, 2.8, 2.3 ) ) ),
  4588.                        list( list( ctlpt( E3, 1.1, 0.1, 0.5 ),
  4589.                                    ctlpt( E3, 1.3, 0.2, 1.7 ),
  4590.                                    ctlpt( E3, 1.5, 0.3, 2.9 ) ),
  4591.                              list( ctlpt( E3, 1.7, 1.2, 0.0 ),
  4592.                                    ctlpt( E3, 1.9, 1.4, 1.2 ),
  4593.                                    ctlpt( E3, 1.2, 1.6, 2.4 ) ),
  4594.                              list( ctlpt( E3, 1.4, 2.3, 0.9 ),
  4595.                                    ctlpt( E3, 1.6, 2.5, 1.7 ),
  4596.                                    ctlpt( E3, 1.8, 2.7, 2.5 ) ) ) ) );
  4597.  
  4598.  creats a trivariate Bezier which is linear in the first direction, and
  4599.  quadratic in the second and third.
  4600. $
  4601.  
  4602. TBSPLINE
  4603.  
  4604.  TrivarType TBSPLINE( NumericType UOrder,
  4605.                       NumericType VOrder,
  4606.                       NumericType WOrder,
  4607.                       ListType CtlMesh,
  4608.                       ListType KnotVectors )
  4609.  
  4610.    Creates a Bspline trivariate with the provided UOrder, VOrder
  4611.  and WOrder orders, the control mesh CtlMesh, and the three knot
  4612.  vectors in KnotVectors.
  4613.    CtlMesh is a list of planes, each of which is a list of rows, each
  4614.  of which is a list of control points. All control points must be of point
  4615.  type (E1-E5, P1-P5), or regular PointType defining the trivariate's control
  4616.  mesh. Trivariate's point type will be of a space which is the union of the
  4617.  spaces of all points.
  4618.    KnotVectors is a list of three knot vectors. Each knot vector is a
  4619.  list of NumericType knots of length #CtlPtList plus the Order.
  4620.  If, however, the length of the knot vector is equal to #CtlPtList +
  4621.  Order + Order - 1} the curve is assumed periodic. 
  4622.    The knot vector may also be a list of a single constant KV_OPEN or
  4623.  KV_FLOAT or KV_PERIODIC, in which a uniform knot vector with the
  4624.  appropriate length and with open, floating or periodic end condition
  4625.  will be constructed automatically.
  4626.  
  4627.  Example:
  4628.  
  4629.    TV = TBSPLINE( 2, 2, 2,
  4630.                   list( list( list( ctlpt( E3, 0.1, 0.1, 0.0 ),
  4631.                                     ctlpt( E3, 0.2, 0.5, 1.1 ),
  4632.                                     ctlpt( E3, 0.3, 0.1, 2.2 ) ),
  4633.                               list( ctlpt( E3, 0.4, 1.3, 0.5 ),
  4634.                                     ctlpt( E3, 0.5, 1.7, 1.7 ),
  4635.                                     ctlpt( E3, 0.6, 1.3, 2.9 ) ),
  4636.                               list( ctlpt( E3, 0.7, 2.4, 0.5 ),
  4637.                                     ctlpt( E3, 0.8, 2.6, 1.4 ),
  4638.                                     ctlpt( E3, 0.9, 2.8, 2.3 ) ) ),
  4639.                         list( list( ctlpt( E3, 1.1, 0.1, 0.5 ),
  4640.                                     ctlpt( E3, 1.3, 0.2, 1.7 ),
  4641.                                     ctlpt( E3, 1.5, 0.3, 2.9 ) ),
  4642.                               list( ctlpt( E3, 1.7, 1.2, 0.0 ),
  4643.                                     ctlpt( E3, 1.9, 1.4, 1.2 ),
  4644.                                     ctlpt( E3, 1.2, 1.6, 2.4 ) ),
  4645.                               list( ctlpt( E3, 1.4, 2.3, 0.9 ),
  4646.                                     ctlpt( E3, 1.6, 2.5, 1.7 ),
  4647.                                     ctlpt( E3, 1.8, 2.7, 2.5 ) ) ) ),
  4648.                   list( list( KV_OPEN ),
  4649.                         list( KV_OPEN ),
  4650.                         list( KV_OPEN ) ) );
  4651.  
  4652.  constructs a trilinear Bspline trivariate with open end conditions.
  4653. $
  4654.  TCRVTR
  4655.  
  4656. TCRVTR
  4657.  
  4658.  AnyType TCRVTR( TrivarType TV, PointType Pos, NumericType ComputeWhat )
  4659.  
  4660.  Compute differential curvature properties of an isosurface of
  4661.  the given trivariate TV at the given (parameteric) location
  4662.  Pos. Following the value of ComputeWhat, the result equals,
  4663.  
  4664.     -1             Initialization (a must prelude)
  4665.     0              Conclusion (a must postlude)
  4666.     1              Returns a vector hold the gradient
  4667.     2              Returns a list of three vectors
  4668.    
  4669.                equal to the Hessian of this location
  4670.     3              Returns a list of two scalar values
  4671.    
  4672.                (Principal curvatures) and two vectors
  4673.    
  4674.                (Principal directions).
  4675.  
  4676.  
  4677.   Every evaluation must start with an invokation with ComputeWhat
  4678.  equal -1 and terminates with ComputeWhat 0.  In both cases, 1 is
  4679.  return in case of success.
  4680.  
  4681.  Example:
  4682.  
  4683.  TCRVTR( TV, point( 0, 0, 0 ), -1 ); # Prelude
  4684.  Grad1 = TCRVTR( TV, point( 0, 0, 0 ),  1 );
  4685.  Grad2 = TCRVTR( TV, point( 0, 0, 1 ),  1 );
  4686.  Grad3 = TCRVTR( TV, point( 0, 1, 0 ),  1 );
  4687.  Grad4 = TCRVTR( TV, point( 1, 0, 0 ),  1 );
  4688.  TCRVTR( TV, point( 0, 0, 0 ), 0 ); #Postlude
  4689. $
  4690.  
  4691. TDERIVE
  4692.  
  4693.  TrivarType TDERIVE( TrivarType TV, NumericType Dir )
  4694.  
  4695.    Returns a vector field trivariate representing the differentiated 
  4696.  trivariate in the given direction (ROW, COL, or DEPTH). Evaluation of the
  4697.  returned trivariate at a given parameter value will return a vector
  4698.  representing the partial derivative of TV in Dir at that
  4699.  parameter value.
  4700.  
  4701.  TV = tbezier( list( list( list( ctlpt( E1, 0.1 ),
  4702.                                  ctlpt( E1, 0.2 ) ),
  4703.                            list( ctlpt( E1, 0.3 ),
  4704.                                  ctlpt( E1, 0.4 ) ) ),
  4705.                      list( list( ctlpt( E1, 2.4 ),
  4706.                                  ctlpt( E1, 2.2 ) ),
  4707.                            list( ctlpt( E1, 2.3 ),
  4708.                                  ctlpt( E1, 2.1 ) ) ) ) );
  4709.  
  4710.  DuTV = TDERIVE( TV, ROW );
  4711.  DvTV = TDERIVE( TV, COL );
  4712.  DwTV = TDERIVE( TV, DEPTH );
  4713.  
  4714.  computes the gradiate of a scalar trivariate field, by computing its
  4715.  partials with respect to u, v, and w.
  4716. $
  4717.  
  4718. TDIVIDE
  4719.  
  4720.  TrivarType TDIVIDE( TrivarType TV, ConstantType Direction,
  4721.                                                           NumericType Param )
  4722.  
  4723.    Subdivides a trivariate into two at the specified parameter value Param
  4724.  in the specified Direction (ROW, COL, or DEPTH). TV can be either
  4725.  a Bspline trivairate in which Param must be conatined in the parametric
  4726.  domain of the trivariate, or a Bezier trivariate in which Param must be
  4727.  in the range of zero to one.
  4728.  
  4729.    It returns a list of the two sub-trivariates. The individual trivariates
  4730.  may be extracted from the list using the NTH command.
  4731.  
  4732.  Example:
  4733.  
  4734.     TvDiv = TDIVIDE( Tv2, depth, 0.3 );
  4735.     Tv2a = nth( TvDiv, 1 ) * tx( -2.2 );
  4736.     Tv2b = nth( TvDiv, 2 ) * tx( 2.0 );
  4737.  
  4738.  subdivides Tv2 at the parameter value of 0.3 in the DEPTH direction,
  4739. $
  4740.  
  4741. TEDITPT
  4742.  
  4743.  TrivarType TEDITPT( TrivarType TV, CtlPtType CPt, NumericType UIndex,
  4744.                                                    NumericType VIndex )
  4745.                                                    NumericType WIndex )
  4746.  
  4747.    Provides a simple mechanism to manually modify a single control point number
  4748.  UIndex, VIndex and WIndex (base count is 0) in the control mesh
  4749.  of Srf by substituting CtlPt instead. CtlPt must have the same
  4750.  point type as the control points of Srf. Original surface Srf is
  4751.  not modified.
  4752.  
  4753.  Example:
  4754.  
  4755.     CPt = ctlpt( E3, 1, 2, 3 );
  4756.     NewTV = TEDITPT( TV, CPt, 0, 0, 0 );
  4757.  
  4758.  Constructs a NewTV with the first control point of TV being
  4759.  CPt.
  4760. $
  4761.  
  4762. TEVAL
  4763.  
  4764.  CtlPtType TEVAL( TrivarType TV,
  4765.                   NumericType UParam,
  4766.                   NumericType VParam,
  4767.                   NumericType WParam )
  4768.  
  4769.    Evaluates the provided trivariate TV at the given UParam,
  4770.  VParam  and WParam values. UParam, VParam,
  4771.  WParam must be contained in the surface parametric domain if TV
  4772.  is a Bspline surface, or between zero and one if TV is a Bezier
  4773.  trivariate. The returned control point has the same type as the control
  4774.  points of TV.
  4775.  
  4776.  Example:
  4777.  
  4778.     CPt = TEVAL( TV1, 0.25, 0.22, 0.7 );
  4779.  
  4780.  evaluates TV at the parameter values of (0.25, 0.22, 0.7).
  4781. $
  4782.  
  4783. TEXTGEOM
  4784.  
  4785.  AnyType TEXTGEOM( StringType Str, VectorType Spacing, NumericType Scaling )
  4786.  
  4787.  Creates a displayable geometry that represents the text in Str, with
  4788.  Spacing space between individual characters. Each character is scaled
  4789.  by Scaling where scaling of one generates a close to a unit size
  4790.  character.
  4791.  
  4792.  Example:
  4793.  
  4794.     a = TEXTGEOM("Text", vector( 0.12, 0, 0 ), 0.1 );
  4795.     b = TEXTGEOM("IRIT", vector( 0, -0.12, 0 ), 0.1 );
  4796.  
  4797.  Creates an horizontal Text and a vertical top to bottom IRIT,
  4798.  both as geometrical objects.
  4799. $
  4800.  
  4801. TFROMSRFS
  4802.  
  4803.  TrivarType TFROMSRFS( ListType SrfList, NumericType OtherOrder )
  4804.  
  4805.    Constructs a trivariate by substituting the surfaces in SrfList as
  4806.  planes in a control mesh of a trivariate. Surfaces in SrfList are
  4807.  made compatible by promoting Bezier surfaces to Bsplines if necessary,
  4808.  and raising degree and refining as required before substituting the
  4809.  control meshes of the surfaces as planes in the mesh of the trivariate.
  4810.  The other, third, direction order is set by OtherOrder, which cannot
  4811.  be larger than the number of surfaces.
  4812.  
  4813.    The trivariate interpolates the first and last surfaces only.
  4814.  
  4815.  Example:
  4816.  
  4817.     s1 = sbezier( list( list( ctlpt( E3, -0.5, -0.5, 0 ),
  4818.                               ctlpt( E3, -0.5,  0.5, 0 ) ),
  4819.                         list( ctlpt( E3,  0.5, -0.5, 0 ),
  4820.                               ctlpt( E3,  0.5,  0.5, 0 ) ) ) ) * sc( 0.3 );
  4821.     Srfs = list( s1 * sc( 2.0 ),
  4822.                  s1 * sx( 1.4 ) * ry( 45 ) * tz( 1.0 ),
  4823.                  s1 * ry( 90 ) * trans( vector( 1.0, 0.0, 1.1 ) ),
  4824.                  s1 * sx( 1.4 ) * ry( 135 ) * trans( vector( 2.0, 0.0, 1.0 ) ),
  4825.                  s1 * sc( 2.0 ) * ry( 180 ) * trans( vector( 2.0, 0.0, 0.0 ) ) );
  4826.     color( Srfs, red );
  4827.  
  4828.     ts = tfromsrfs( Srfs, 3 );
  4829.     color( ts, green );
  4830.     view( list( Srfs, ts ), on );
  4831.  
  4832.  Constructs a trivariate from five planar surfaces and display both the
  4833.  trivariate and the five planar surfaces, in different colors.
  4834. $
  4835.  
  4836. TINTERP
  4837.  
  4838.  TrivarType TINTERP( TrivarType TV );
  4839.  
  4840.    Given a trivariate data structure, computes a new trivariate in the
  4841.  same function space (i.e. same knot sequences and orders) that interpolates
  4842.  the given triavriate, TV, at the node parameter values.
  4843.  
  4844.  Example:
  4845.  
  4846.      tv = tbspline( 3, 3, 2,
  4847.                     list( list( list( ctlpt( E3, 0.1, 0.1, 0.0 ),
  4848.                                       ctlpt( E3, 0.2, 0.5, 1.1 ),
  4849.                                       ctlpt( E3, 0.3, 0.1, 2.2 ) ),
  4850.                                 list( ctlpt( E3, 0.4, 1.3, 0.5 ),
  4851.                                       ctlpt( E3, 0.5, 1.7, 1.7 ),
  4852.                                       ctlpt( E3, 0.6, 1.3, 2.9 ) ),
  4853.                                 list( ctlpt( E3, 0.7, 2.4, 0.5 ),
  4854.                                       ctlpt( E3, 0.8, 2.6, 1.4 ),
  4855.                                       ctlpt( E3, 0.9, 2.8, 2.3 ) ) ),
  4856.                           list( list( ctlpt( E3, 1.1, 0.1, 0.5 ),
  4857.                                       ctlpt( E3, 1.3, 0.2, 1.7 ),
  4858.                                       ctlpt( E3, 1.5, 0.3, 2.9 ) ),
  4859.                                 list( ctlpt( E3, 1.7, 1.2, 0.0 ),
  4860.                                       ctlpt( E3, 1.9, 1.4, 1.2 ),
  4861.                                       ctlpt( E3, 1.2, 1.6, 2.4 ) ),
  4862.                                 list( ctlpt( E3, 1.4, 2.3, 0.9 ),
  4863.                                       ctlpt( E3, 1.6, 2.5, 1.7 ),
  4864.                                       ctlpt( E3, 1.8, 2.7, 2.5 ) ) ),
  4865.                           list( list( ctlpt( E3, 2.8, 0.1, 0.4 ),
  4866.                                       ctlpt( E3, 2.6, 0.7, 1.3 ),
  4867.                                       ctlpt( E3, 2.4, 0.2, 2.2 ) ),
  4868.                                 list( ctlpt( E3, 2.2, 1.1, 0.4 ),
  4869.                                       ctlpt( E3, 2.9, 1.2, 1.5 ),
  4870.                                       ctlpt( E3, 2.7, 1.3, 2.6 ) ),
  4871.                                 list( ctlpt( E3, 2.5, 2.9, 0.7 ),
  4872.                                       ctlpt( E3, 2.3, 2.8, 1.7 ),
  4873.                                       ctlpt( E3, 2.1, 2.7, 2.7 ) ) ) ),
  4874.                     list( list( KV_OPEN ),
  4875.                           list( KV_OPEN ),
  4876.                           list( KV_OPEN ) ) );
  4877.     tvi = TINTERP( tv );
  4878.  
  4879.  creates a quadratic by quaratic by linear trivairatiate tvi that
  4880.  interpolates the control points of tv at the node parameter values.
  4881. $
  4882.  
  4883. TMORPH
  4884.  
  4885.  TrivarType TMORPH( TrivarType TV1, SurfaceType TV2, NumericType Blend )
  4886.  
  4887.  Creates a new trivariate which is a convex blend of the two given
  4888.  trivariates.  The two given trivariates must be compatible (see FFCOMPAT)
  4889.  before this blend is invoked. Very useful if a sequence that "morphs" one
  4890.  trivariate to another is to be created and in combination of MRCHCUBE.
  4891.  
  4892.  Example:
  4893.  
  4894.     Size = 0.05;
  4895.     for ( i = 0, step, 1.0,
  4896.         Tv = TMORPH( Tv1, Tv2, i ):
  4897.         view( mrchcube( list( Tv, 1, off ),
  4898.                         point( Size, Size, Size ), 1, IsoVal ), on ) );
  4899.  
  4900.  creates a sequence of 1/step trivariates, morphed from Tv1 to Tv2
  4901.  and displays an extracted iso surface at level IsoVal.
  4902.  See also MRCHCUBE, CMORPH and SMORPH.
  4903. $
  4904.  
  4905. TORUS
  4906.  
  4907.  PolygonType TORUS( VectorType Center, VectorType Normal,
  4908.                     NumericType MRadius, NumericType mRadius )
  4909.  
  4910.    Creates a TORUS geometric object, defined by Center as the center
  4911.  of the TORUS, Normal as the normal to the main plane of the TORUS,
  4912.  MRadius and mRadius as the major and minor radii of the TORUS.
  4913.    See RESOLUTION for the accuracy of the TORUS approximation as a polygonal
  4914.  model. See IRITSTATE's "PrimRatSrfs" and "PrimRatSrfs" state variables.
  4915.  
  4916.  Example:
  4917.  
  4918.     T = TORUS( vector( 0.0, 0.0, 0.0), vector( 0.0, 0.0, 1.0), 0.5, 0.2 );
  4919.  
  4920.  constructs a torus with major plane as the XY plane, major radius of 0.5,
  4921.  and minor radius of 0.2.
  4922. $
  4923.  
  4924. TRAISE
  4925.  
  4926.  TrivarType TRAISE( TrivarType TV, ConstantType Direction,
  4927.                       NumericType NewOrder )
  4928.  
  4929.    Raise TV to the specified NewOrder in the specified
  4930.  Direction.
  4931.  
  4932.  Example:
  4933.  
  4934.     tv1r = TRAISE( traise( traise( tv1, row, 4 ), col, 4 ), depth, 4 );
  4935.  
  4936.  Ensures that the trivariate is a tricubic.
  4937. $
  4938.  
  4939. TREFINE
  4940.  
  4941.  TrivarType TREFINE( TrivarType TV, ConstantType Direction,
  4942.                      NumericType Replace, ListType KnotList )
  4943.  
  4944.    Provides the ability to Replace a knot vector of TV or refine 
  4945.  it in the specified direction Direction (ROW, COL, or DEPTH).
  4946.    KnotList is a list of knots to refine TV at. All knots should be
  4947.  contained in the parametric domain of TV in Direction. If the knot
  4948.  vector is replaced, the length of KnotList should be identical to the
  4949.  length of the original knot vector of TV in Direction. If TV
  4950.  is a Bezier trivariate, it is automatically promoted to be a Bspline
  4951.  trivariate.
  4952.  
  4953.  Example:
  4954.  
  4955.     TV = TREFINE( TREFINE( TREFINE( TV,
  4956.                                     ROW, FALSE, list( 0.333, 0.667 ) ),
  4957.                            COL, FALSE, list( 0.333, 0.667 ) ),
  4958.                   DEPTH, FALSE, list( 0.333, 0.667 ) );
  4959.  
  4960.  refines TV in all directions by adding two more knots at 0.333 and
  4961.  0.667.
  4962. $
  4963.  
  4964. TREGION
  4965.  
  4966.  TrivarType TREGION( TrivarType TV, ConstantType Direction,
  4967.                      NumericType MinParam, NumericType MaxParam )
  4968.  
  4969.    Extracts a region of TV between MinParam and MaxParam
  4970.  in the specified Direction. Both MinParam and MaxParam
  4971.  should be contained in the parametric domain of TV in Direction.
  4972.  
  4973.  Example:
  4974.  
  4975.     Tv1 = tbezier( list( list( list( ctlpt( E3, 0.1, 0.0, 0.8 ),
  4976.                                      ctlpt( E3, 0.2, 0.1, 2.4 ) ),
  4977.                                list( ctlpt( E3, 0.3, 2.2, 0.2 ),
  4978.                                      ctlpt( E3, 0.4, 2.3, 2.0 ) ) ),
  4979.                          list( list( ctlpt( E3, 2.4, 0.8, 0.1 ),
  4980.                                      ctlpt( E3, 2.2, 0.7, 2.3 ) ),
  4981.                                list( ctlpt( E3, 2.3, 2.6, 0.5 ),
  4982.                                      ctlpt( E3, 2.1, 2.5, 2.7) ) ) ) );
  4983.  
  4984.     Tv1r1 = TREGION( Tv1, row, 0.1, 0.2 );
  4985.     Tv1r2 = TREGION( Tv1, row, 0.4, 0.6 );
  4986.     Tv1r3 = TREGION( Tv1, row, 0.99, 1.0 );
  4987.  
  4988.  extracts three regions of Tv1 along the ROW direction.
  4989. $
  4990.  
  4991. TREPARAM
  4992.  
  4993.  TrivarType TREPARAM( TrivarType TV, ConstantType Direction,
  4994.                       NumericType MinParam, NumericType MaxParam )
  4995.  
  4996.    Reparametrize TV over a new domain from MinParam to MaxParam,
  4997.  in the prescribed Direction. This operation does not affect the geometry
  4998.  of the trivariate and only affine transforms its knot vectors. A Bezier
  4999.  trivariate will automatically be promoted into a Bspline surface by this
  5000.  function.
  5001.  
  5002.  Example:
  5003.  
  5004.     Tv = TREPARAM( TREPARAM( TREPARAM( tv, row, 0, 1 ),
  5005.                              col, 0, 1 ),
  5006.                    depth, 0, 1 );
  5007.  
  5008.  Ensures that the trivariate is defined over the unit size parametric
  5009.  cube.
  5010. $
  5011.  
  5012. TRIANGL
  5013.  
  5014.  PolygonType TRIANGL( PolygonType Model ) 
  5015.  
  5016.  Converts Model into a new model with exactly the same shape that holds
  5017.  only triangles.
  5018. $
  5019.  
  5020. TRIMSRF
  5021.  
  5022.  TrimSrfType TRIMSRF( SurfaceType Srf,
  5023.                       CurveType TrimCrv,
  5024.                       NumericType HasUpperLevel )
  5025.  
  5026.  or
  5027.  
  5028.  TrimSrfType TRIMSRF( SurfaceType Srf,
  5029.                       ListType TrimCrvs,
  5030.                       NumericType HasUpperLevel )
  5031.  
  5032.    Creates a trimmed surface from the provided surface Srf and the
  5033.  trimming curve TrimCrv or curves TrimCrvs. If HasUpperLevel
  5034.  is FALSE, an additional trimming curve is automatically being added that
  5035.  contains the entire parametric domain of Srf. No validity test is
  5036.  performed on the trimming curves which are assumed two dimensional curves
  5037.  contained in the parametric domain of Srf.
  5038.  
  5039.  Example:
  5040.  
  5041.     spts = list( list( ctlpt( E3, 0.1, 0.0, 1.0 ),
  5042.                        ctlpt( E3, 0.3, 1.0, 0.0 ),
  5043.                        ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  5044.                  list( ctlpt( E3, 1.1, 0.0, 0.0 ),
  5045.                        ctlpt( E3, 1.3, 1.5, 2.0 ),
  5046.                        ctlpt( E3, 1.0, 2.1, 0.0 ) ),
  5047.                  list( ctlpt( E3, 2.1, 0.0, 2.0 ),
  5048.                        ctlpt( E3, 2.3, 1.0, 0.0 ),
  5049.                        ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  5050.                  list( ctlpt( E3, 3.1, 0.0, 0.0 ),
  5051.                        ctlpt( E3, 3.3, 1.5, 2.0 ),
  5052.                        ctlpt( E3, 3.0, 2.1, 0.0 ) ),
  5053.                  list( ctlpt( E3, 4.1, 0.0, 1.0 ),
  5054.                        ctlpt( E3, 4.3, 1.0, 0.0 ),
  5055.                        ctlpt( E3, 4.0, 2.0, 1.0 ) ) );
  5056.     sb = sbspline( 3, 3, spts, list( list( KV_OPEN ), list( KV_OPEN ) ) );
  5057.     
  5058.     TCrv1 = cbspline( 2,
  5059.                       list( ctlpt( E2, 0.3, 0.3 ),
  5060.                             ctlpt( E2, 0.7, 0.3 ),
  5061.                             ctlpt( E2, 0.7, 0.7 ),
  5062.                             ctlpt( E2, 0.3, 0.7 ),
  5063.                             ctlpt( E2, 0.3, 0.3 ) ),
  5064.                       list( KV_OPEN ) );
  5065.     TCrv2 = circle( vector( 0.5, 0.5, 0.0 ), 0.25 );
  5066.     TCrv3 = cbspline( 3,
  5067.                       list( ctlpt( E2, 0.3, 0.3 ),
  5068.                             ctlpt( E2, 0.7, 0.3 ),
  5069.                             ctlpt( E2, 0.7, 0.7 ),
  5070.                             ctlpt( E2, 0.3, 0.7 ) ),
  5071.                       list( KV_PERIODIC ) );
  5072.     
  5073.     TSrf1 = TRIMSRF( sb, TCrv1, false );
  5074.     TSrf2 = TRIMSRF( sb, TCrv1, true );
  5075.     TSrf3 = TRIMSRF( sb, list( TCrv1, TcRv2 * ty( 1 ), TCrv3 * ty( 2 ) ),
  5076.                      false );
  5077.  
  5078.  constructs three trimmed surfaces. Tsrf1 contains the outer boundary
  5079.  and excludes what is inside TCrv1, TSrf2 contains only the
  5080.  domain inside TCrv1. TCrv3 has three holes corresponds to the
  5081.  three trimming curves.
  5082. $
  5083.  
  5084. TSBEZIER
  5085.  
  5086.  SurfaceType TSBEZIER( NumericType Order, ListType CtlMesh )
  5087.  
  5088.    Creates a triangular Bezier surface of oder Order using the
  5089.  provided control mesh. CtlMesh is a list of control points of
  5090.  size (Order + 1) * Order / 2. All control points
  5091.  must be of type (E1-E5, P1-P5), or regular PointType defining the surface's
  5092.  control polygon.  Surface's point type will be of a space which is the union
  5093.  of the spaces of all points.
  5094.  
  5095.  Example:
  5096.  
  5097.     b = TSBEZIER( 3,
  5098.                   list( ctlpt( E3, 0.0,  0.0,  0.4 ),
  5099.                         ctlpt( E3, 0.3,  0.0,  0.3 ),
  5100.                         ctlpt( E3, 0.7,  0.0,  0.8 ),
  5101.      
  5102.                         ctlpt( E3, 0.2,  0.4,  1.0 ),
  5103.                         ctlpt( E3, 0.4,  0.5,  1.0 ),
  5104.      
  5105.                         ctlpt( E3, 0.5,  1.0,  0.7 ) ) );
  5106. $
  5107.  
  5108. TSBSPLINE
  5109.  
  5110.  TriSrfType TSBSPLINE( NumericType Order, NumericType Length,
  5111.                        ListType CtlMesh, ListType KnotVector )
  5112.  
  5113.    Creates a Bspline surface from the provided Order and Length,
  5114.  the control mesh CtlMesh, and the knot vector KnotVector.
  5115.  CtlMesh is a list of control points of size (Length + 1) *
  5116.  Length / 2.  All control points must be of point type (E1-E5,
  5117.  P1-P5), or regular PointType defining the surface's control mesh.
  5118.  Surface's point type will be of a space which is the union of the spaces
  5119.  of all points.
  5120.    KnotVector is a list of NumericType knots of length Length
  5121.  plus the Order.
  5122.    The knot vector may also be a list of a single constant KV_OPEN or
  5123.  KV_FLOAT, in which a uniform knot vector with the appropriate length
  5124.  and with open or floating end condition will be constructed automatically.
  5125.  
  5126.  Not fully supported at this time.
  5127. $
  5128.  
  5129. TSDERIVE
  5130.  
  5131.  TriSrfType TSDERIVE( TriSrfType Srf, NumericType Dir )
  5132.  
  5133.    Returns a vector field surface representing the differentiated triangular
  5134.  surface in the given direction (ROW, COL, or DEPTH). Evaluation of
  5135.  the returned surface at a given parameter value will return a vector
  5136.  tangent to Srf in Dir at that parameter value.
  5137.  
  5138.  DuSrf = TSDERIVE( Srf, ROW );
  5139.  DvSrf = TSDERIVE( Srf, COL );
  5140.  Normal = coerce( tseval( DuSrf, 0.5, 0.25, 0.25 ), VECTOR_TYPE ) ^
  5141.           coerce( tseval( DvSrf, 0.5, 0.25, 0.25 ), VECTOR_TYPE );
  5142.  
  5143.  computes two partial derivatives of the surface Srf and computes
  5144.  its normal as their cross product, at the parametric location
  5145.  (0.5, 0.25, 0.25).
  5146.  
  5147.  See also TSNORMAL
  5148. $
  5149.  
  5150. TSEVAL
  5151.  
  5152.  CtlPtType TSEVAL( TriSrfType Srf,
  5153.                    NumericType UParam, NumericType VParam, NumericType WParam )
  5154.  
  5155.    Evaluates the provided triangulae surface Srf at the given
  5156.  UParam, VParam, WParam parameters.
  5157.  UParam, VParam, and WParam must all be non negative
  5158.  and must sum to one for a Bezier triangular surface or to the maximum
  5159.  domain, if Bspline surface.
  5160.  
  5161.  Example:
  5162.  
  5163.     CPt = TSEVAL( Srf, u, v, 1.0 - u - v );
  5164.  
  5165.  Evaluates Srf at the parameter values prescribed by u and v.
  5166. $
  5167.  
  5168. TSNORMAL
  5169.  
  5170.  VectorType TSNORMAL( TriSrfType Srf,
  5171.                       NumericType UParam, NumericType VParam, NumericType WParam)
  5172.  
  5173.    Computes the normal vector to a triangular surface Srf at the
  5174.  parameter values UParam, VParam, WParam. The returned
  5175.  vector has a unit length.
  5176.  
  5177.    UParam, VParam, and WParam must all be non
  5178.  negative and must sum to one for a Bezier triangular surface or to
  5179.  the maximum domain, if Bspline surface.
  5180.  
  5181.  Example:
  5182.  
  5183.     Normal = TSNORMAL( Srf, 0.5, 0.5, 0.0 );
  5184.  
  5185.  computes the normal to Srf at the parameter values (0.5, 0.5, 0.0).
  5186. $
  5187.  
  5188. TVLOAD
  5189.  
  5190.  TrivarType TVLOAD( StringType FileName,
  5191.                     NumericType DataType,
  5192.                     VectorType VolSize,
  5193.                     VectorType Orders )
  5194.  
  5195.  Loads a volumetric data set from file FileName in as a
  5196.  trivariate of orders Orders.  DataType can be one of:
  5197.  
  5198.     1          Regular ascii (separated by while spaces).
  5199.     2          Two bytes short integer.
  5200.     3          Four bytes long integer.
  5201.     4          One byte (char) integer.
  5202.     5          Four bytes float.
  5203.     6          Eight bytes double.
  5204.  
  5205.  Beware of the little vs big Endian problem! We assume here you read in the
  5206.  volume in the same machine type this file was writeen with.
  5207.  
  5208.  VolSize provides the dimensions of the volume, with width first and
  5209.  depth last.  Uniform open end condition knot vector are constructed to all
  5210.  three axes.
  5211.  
  5212.  Example:
  5213.  
  5214.     Tv = tvload( "3dhead", 1, vector( 32, 32, 13 ), vector( 3, 3, 3 ) );
  5215.  
  5216.  loads the data set "3dhead" of size (32, 32, 13) as a triquadratic
  5217.  function.  Data set is assumed to contain ascii numeric values.
  5218.  
  5219.  See also MRCHCUBE.
  5220. $
  5221.  
  5222.  
  5223. Object transformation functions
  5224.  
  5225.  All the routines in this section construct a 4 by 4 homogeneous
  5226.  transformation matrix representing the required transform. These matrices
  5227.  may be concatenated to achieve more complex transforms using the matrix
  5228.  multiplication operator *. For example, the expression
  5229.  
  5230.     m = trans( vector( -1, 0, 0 ) ) * rotx( 45 ) * trans( vector( 1, 0, 0 ) );
  5231.  
  5232.  constructs a transform to rotate an object around the X = 1 line, 45 degrees.
  5233.  A matrix representing the inverse transformation can be computed as:
  5234.     InvM = m ^ -1
  5235.  See also overloading of the - operator.
  5236. $
  5237.  
  5238. HOMOMAT
  5239.  
  5240.  MatrixType HOMOMAT( ListType MatData )
  5241.  
  5242.    Creates an arbitrary homogeneous transformation matrix by manually providing
  5243.  its 16 coefficients.
  5244.  Example:
  5245.  
  5246.  for ( a = 1, 1, 720 / step,
  5247.        view_mat = save_mat *
  5248.                   HOMOMAT( list( list( 1, 0, 0, 0 ),
  5249.                                  list( 0, 1, 0, 0 ),
  5250.                                  list( 0, 0, 1, -a * step / 500 ),
  5251.                                  list( 0, 0, 0, 1 ) ) ):
  5252.        view( list( view_mat, axes ), on )
  5253.  );
  5254.  
  5255.  looping and viewing through a sequence of perspective transforms, created
  5256.  using the HOMOMAT constructor.
  5257. $
  5258.  
  5259. ROTVEC
  5260.  
  5261.  MatrixType ROTVEC( VectorType Vec, NumericType Angle )
  5262.  
  5263.    Creates a rotation around the vector Vec matrix with Angle degrees.
  5264. $
  5265.  
  5266. ROTX
  5267.  
  5268.  MatrixType ROTX( NumericType Angle )
  5269.  
  5270.    Creates a rotation around the X transformation matrix with Angle degrees.
  5271. $
  5272.  
  5273. ROTY
  5274.  
  5275.  MatrixType ROTY( NumericType Angle )
  5276.  
  5277.    Creates a rotation around te Y transformation matrix with Angle degrees.
  5278. $
  5279.  
  5280. ROTZ
  5281.  
  5282.  MatrixType ROTZ( NumericType Angle )
  5283.  
  5284.    Creates a rotation around the Z transformation matrix with Angle degrees.
  5285. $
  5286.  
  5287. ROTZ2V
  5288.  
  5289.  MatrixType ROTZ2V( VectorType Dir )
  5290.  
  5291.    Creates a rotation matrix that takes Z axis into Dir. Length of Dir
  5292.  is ignored.
  5293. $
  5294.  
  5295. ROTZ2V2
  5296.  
  5297.  MatrixType ROTZ2V2( VectorType Dir, VectorType Dir2 )
  5298.  
  5299.    Creates a rotation matrix that takes Z axis into Dir, while the X axis
  5300.  is aligned with Dir2. The lengths of Dir and Dir2 are ignored.
  5301. $
  5302.  
  5303. SCALE
  5304.  
  5305.  MatrixType SCALE( VectorType ScaleFactors )
  5306.  
  5307.    Creates a scaling by the ScaleFactors transformation matrix.
  5308. $
  5309.  
  5310. TRANS
  5311.  
  5312.  MatrixType TRANS( VectorType TransFactors )
  5313.  
  5314.    Creates a translation by the TransFactors transformation matrix.
  5315. $
  5316.  
  5317. General purpose functions  
  5318. $
  5319.  
  5320. ATTRIB
  5321.  
  5322.  ATTRIB( AnyType Object, StringType Name, AnyType Value )
  5323.  
  5324.    Provides a mechanism to add an attribute of any type to an Object,
  5325.  with name Name and value Value. This ATTRIB function is tuned
  5326.  and optimized toward numeric values or strings as Value although any
  5327.  other object type can be saved as attribue.
  5328.  
  5329.    These attributes may be used to pass information to other programs about
  5330.  this object, and are saved with the objects in data files.
  5331.  Attributes placed on a list object or even a whole hierarchy of
  5332.  objects will be propagated into all items in the list or hierarchy.
  5333.    The exception to this propagation are few. The "animation" attribute that
  5334.  is not propagated and is kept in the internal nodes, forming an hierachy of
  5335.  animation commands for all the objects contained in the list/hierarchy.
  5336.  The "invisible" attribute is saved at all levels of the hierarchy, used to
  5337.  denote a complete sub tree that is invisible (yet can serve as a source
  5338.  instances can point at).
  5339.  
  5340.  For example,
  5341.  
  5342.     ATTRIB(Glass, "rgb", "255,0,0");
  5343.     ATTRIB(Glass, "refract", "1.4");
  5344.         .
  5345.         .
  5346.         .
  5347.     RMATTR(Glass, "rgb");   # Removes "rgb" attribute.
  5348.  
  5349.  sets the RGB color and refraction index of the Glass object and
  5350.  later removes the RGB attribute.
  5351.  
  5352.    Attribute names are case insensitive. Spaces are allowed in the Value
  5353.  string, as well as the double quote itself, although the latter must be
  5354.  escaped:
  5355.  
  5356.     ATTRIB(Glass, "text", "Say "this is me"");
  5357.  
  5358.    See also RMATTR for removal of attributes as well as AWIDTH, ADWIDTH, and
  5359.  COLOR.
  5360. $
  5361.  
  5362. ADWIDTH
  5363.  
  5364.  ADWIDTH( GeometricType Object, NumericType DWidth )
  5365.  
  5366.    Sets the width of the object.  This display width is used in pixels in
  5367.  display devices for width of line drawing, if supported by the display device.
  5368.    See also ATTRIB, COLOR, and AWIDTH.
  5369.  
  5370.    This function is equivament to using,
  5371.  
  5372.                          ATTRIB( Object, "dwidth", Width );
  5373. $
  5374.  
  5375. AWIDTH
  5376.  
  5377.  AWIDTH( GeometricType Object, NumericType Width )
  5378.  
  5379.    Sets the width of the object to one of those specified below.  This width
  5380.  is used in real object side dimensions in tools such as scan converters and
  5381.  rendering tools for rendering lines and curves, as well as postscript.
  5382.    See also ATTRIB, COLOR, and ADWIDTH.
  5383.  
  5384.    This function is equivament to using,
  5385.  
  5386.                          ATTRIB( Object, "width", Width );
  5387. $
  5388.  
  5389. CHDIR
  5390.  
  5391.  CHDIR( StringType NewDir )
  5392.  
  5393.    Sets the current working directory to be NewDir.
  5394. $
  5395.  
  5396. CLNTCLOSE
  5397.  
  5398.  CLNTCLOSE( NumericType Handler, NumericType Kill )
  5399.  
  5400.    Closes a communication channel to a client. Handler contains the
  5401.  index of the communication channel opened via CLNTEXEC. If Kill, the
  5402.  client is send an  exit request for it to die. Otherwise, the communication
  5403.  is closed and the client is running stand alone.  See also CLNTREAD,
  5404.  CLNTWRITE, and CLNTEXEC.
  5405.  
  5406.  Example:
  5407.  
  5408.    h2 = clntexec( "nuldrvs -s-" );
  5409.        .
  5410.        .
  5411.        .
  5412.  
  5413.    CLNTCLOSE( h2,TRUE );
  5414.  
  5415.  closes the connection to the nuldrvs client, opened via CLNTEXEC.
  5416. $
  5417.  
  5418. CLNTWRITE
  5419.  
  5420.  CLNTWRITE( NumericType Handler, AnyType Object )
  5421.  
  5422.    Writes one object Object to a communication channel of a client.
  5423.  Handler contains the index of the communication channel opened via
  5424.  CLNTEXEC.  See also CLNTREAD, CLNTCLOSE, and CLNTEXEC.
  5425.  
  5426.  Example:
  5427.  
  5428.    h2 = clntexec( "nuldrvs -s-" );
  5429.        .
  5430.        .
  5431.  
  5432.    CLNTWRITE( h2, Model );
  5433.        .
  5434.        .
  5435.  
  5436.    clntclose( h2,TRUE );
  5437.  
  5438.  writes the object named Model to client through communication channel h2.
  5439. $
  5440.  
  5441. COLOR
  5442.  
  5443.  COLOR( GeometricType Object, NumericType Color )
  5444.  
  5445.    Sets the color of the object to one of those specified below. Note that an
  5446.  object has a default color (see IRIT.CFG file) according to its origin -
  5447.  loaded with the LOAD command, PRIMITIVE, or BOOLEAN operation result.
  5448.    The system internally supports colors (although you may have a B&W system)
  5449.  and the colors recognized are:
  5450.  BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW, and WHITE.
  5451.  
  5452.    See the ATTRIB command for more fine control of colors using the RGB
  5453.  attribute. See also AWIDTH and AWIDTH.
  5454.  
  5455.    This function is equivament to using,
  5456.  
  5457.                          ATTRIB( Object, "color", Width );
  5458. $
  5459.  
  5460. COMMENT
  5461.  
  5462.  COMMENT
  5463.  
  5464.  Two types of comments are allowed:
  5465.  
  5466.  1. One-line comment: starts anywhere in a line at the '#' character, up to
  5467.     the end of the line.
  5468.  
  5469.  2. Block comment: starts at the COMMENT keyword followed by a unique
  5470.     character (anything but white space), up to the second occurrence of that
  5471.     character. This is a fast way to comment out large blocks.
  5472.  
  5473.  Example:
  5474.  
  5475.     COMMENT 
  5476.       This is a comment
  5477.     
  5478. $
  5479.  
  5480. ERROR
  5481.  
  5482.  ERROR( StringType Message);
  5483.  
  5484.  Breaks the execution and returns to IRIT main loop, after printing
  5485.  Message to the screen. May be useful in user defined function to
  5486.  break execution in cases of fatal errors.
  5487. $
  5488.  
  5489. EXIT
  5490.  
  5491.  EXIT();
  5492.  
  5493.    Exits from the solid modeler. NO warning is given!
  5494. $
  5495.  
  5496. FOR
  5497.  
  5498.  FOR( NumericType Start, NumericType Increment, NumericType End, AnyType Body )
  5499.  
  5500.    Executes the Body (see below), while the FOR loop conditions hold.
  5501.    Start, Increment, End are evaluated first, and the loop is executed
  5502.  while <= End if Increment > 0, or while >= End if Increment < 0.
  5503.    If Start is of the form "Variable = Expression", then that variable is
  5504.  updated on each iteration, and can be used within the body.
  5505.    The body may consist of any number of regular commands, separated by
  5506.  COLONs, including nesting FOR loops to an arbitrary level.
  5507.  
  5508.  Example:
  5509.  
  5510.  step = 10;
  5511.  rotstepx = rotx(step);
  5512.  FOR ( a = 1, 1, 360 / step,
  5513.      view_mat = rotstepx * view_mat:
  5514.      view( list( view_mat, axes ), ON )
  5515.  );
  5516.  
  5517.  Displays axes with a view direction that is rotated 10 degrees at a
  5518.  time around the X axis.
  5519. $
  5520.  
  5521. HELP
  5522.  
  5523.  HELP( StringType Subject )
  5524.  
  5525.    Provides help on the specified Subject.
  5526.  
  5527.  Example:
  5528.  
  5529.     HELP("");
  5530.  
  5531.  will list all IRIT help subjects.
  5532. $
  5533.  
  5534. FREE
  5535.  
  5536.  FREE( GeometricType Object )
  5537.  
  5538.    Because of the usually huge size of geometric objects, this procedure
  5539.  may be used to free them. Reassigning a value (even of different type)
  5540.  to a variable automatically releases the old variable's allocated space
  5541.  as well.
  5542. $
  5543.  
  5544. FUNCTION
  5545.  
  5546.  FuncName = FUNCTION(Prm1, Prm2, ... , PrmN):LclVal1:LclVar2: ... :LclVarM:
  5547.      FuncBody;
  5548.  
  5549.  Defines a function named FuncName with N parameters and M local variables
  5550.  (N, M >= 0). Here is a (simple) example of a function with no local variables
  5551.  and a single parameter that computes the square of a number:
  5552.  
  5553.  sqr = FUNCTION(x):
  5554.     return = x * x;
  5555.  
  5556.    Functions can be defined with optional parameters and optional local
  5557.  variables. A function's body may contain an arbitrary set of expressions
  5558.  including for/while loops, (user) function calls, or even recursive function
  5559.  calls, all separated by colons.
  5560.    The returned value of the function is the value of an automatically defined
  5561.  local variable named return. The return variable is a regular local variable
  5562.  within the scope of the function and can be used as any other variable.
  5563.  
  5564.    If a variable's name is found in neither the local variable list nor
  5565.  the parameter list, it is searched in the global variable list (outside
  5566.  the scope of the function). Binding of names of variables is static as in the
  5567.  C programming language.
  5568.  
  5569.    Because binding of variables is performed in execution time, there is a
  5570.  somewhat less restrictive type checking of parameters of functions that are
  5571.  invoked within a user's defined function.
  5572.  
  5573.    A function can invoke itself, i.e., it can be recursive. However, since a
  5574.  function should be defined when it is called, a dummy function should be
  5575.  defined before the recursive one is defined:
  5576.  
  5577.  factorial = function(x):return = x; # Dummy function.
  5578.  factorial = function(x):
  5579.      if (x <= 1, return = 1, return = x * factorial(x - 1));
  5580.  
  5581.    Overloading is valid inside a function as it is outside. For example, for
  5582.  
  5583.  add = FUNCTION(x, y):
  5584.     return = x + y;
  5585.  
  5586.  the following function calls are all valid:
  5587.  
  5588.  add(1, 2);
  5589.  add(vector(1,2,3), point(1,2,3));
  5590.  add(box(vector(-3, -2, -1), 6, 4, 2), box(vector(-4, -3, -2), 2, 2, 4));
  5591.  
  5592.  Finally, here is a more interesting example that computes an approximation
  5593.  of the length of a curve, using the sqr function defined above:
  5594.  
  5595.  distptpt = FUNCTION(pt1, pt2):
  5596.      return = sqrt(sqr(coord(pt1, 1) - coord(pt2, 1)) +
  5597.                    sqr(coord(pt1, 2) - coord(pt2, 2)) +
  5598.                    sqr(coord(pt1, 3) - coord(pt2, 3)));
  5599.  
  5600.  crvlength = FUNCTION(crv, n):pd:t:t1:t2:dt:pt1:pt2:i:
  5601.      return = 0.0:
  5602.      pd = pdomain(crv):
  5603.      t1 = nth(pd, 1):
  5604.      t2 = nth(pd, 2):
  5605.      dt = (t2 - t1) / n:
  5606.      pt1 = coerce(ceval(crv, t1), e3):
  5607.      for (i = 1, 1, n,
  5608.           pt2 = coerce(ceval(crv, t1 + dt * i), e3):
  5609.           return = return + distptpt(pt1, pt2):
  5610.           pt1 = pt2);
  5611.  
  5612.  Try, for example:
  5613.  
  5614.  crvlength(circle(vector(0.0, 0.0, 0.0), 1.0), 30) / 2;
  5615.  crvlength(circle(vector(0.0, 0.0, 0.0), 1.0), 100) / 2;
  5616.  crvlength(circle(vector(0.0, 0.0, 0.0), 1.0), 300) / 2;
  5617.  
  5618.  See PROCEDURE and IRITSTATE's "DebugFunc" for more.
  5619. $
  5620.  
  5621. IF
  5622.  
  5623.  IF( NumericType Cond, AnyType TrueBody { , AnyType FalseBody } )
  5624.  
  5625.    Executes TrueBody (group of regular commands, separated by COLONs -
  5626.  see FOR loop) if the Cond holds, i.e., it is a numeric value other than
  5627.  zero, or optionally, if it exists, executes FalseBody if the Cond
  5628.  does not hold, i.e., it evaluates to a numeric value equal to zero.
  5629.  
  5630.  Examples:
  5631.  
  5632.     IF ( machine == IBMOS2, resolution = 5, resolution = 10 );
  5633.     IF ( a > b, max = a, max = b );
  5634.  
  5635.  sets the resolution to be 10, unless running on an IBMOS2 system, in which
  5636.  case the RESOLUTION variable will be set to 5 in the first statement, and
  5637.  set max to the maximum of a and b in the second statement.
  5638. $
  5639.  
  5640. INCLUDE
  5641.  
  5642.  INCLUDE( StringType FileName )
  5643.  
  5644.    Executes the script file FileName. Nesting of include file is allowed up
  5645.  to 10 levels deep. If an error occurs, all open files in all nested files
  5646.  are closed and data are waited for at the top level (standard input).
  5647.  
  5648.    A script file can contain any command the solid modeler supports.
  5649.  
  5650.  Example:
  5651.  
  5652.     INCLUDE( "general.irt" );
  5653.  
  5654.  includes the file "general.irt".
  5655. $
  5656.  
  5657. IRITSTATE
  5658.  
  5659.  IRITSTATE( StringType State, AnyType Data )
  5660.  
  5661.    Sets a state variable in the IRIT solid modeller. Current supported
  5662.  state variables are,
  5663.  
  5664.  
  5665.     State Name    Data Type    Comments   
  5666.     Coplanar      NumericType  If TRUE, Coplanar polygons are handled by
  5667.                                Boolean    
  5668.     DebugMalloc   StringType   If "Reset", memory allocation is cleared/reset.
  5669.                                No "Free unallocated pointer" test after
  5670.                                "Reset".  If "Print", all allocated blocks are
  5671.                                printed.  Otherwise, used as "address, n": ptr
  5672.                                address to search for with abort() called after
  5673.                                n mallocs. 
  5674.     DebugFunc     NumericType  >0 user func. debug information. >2 print params
  5675.                                on entry, ret. val. on exit. >4 global var. list
  5676.                                operations. 
  5677.     DumpLevel     NumericType  Controls the way variables/expressions are
  5678.                                dumped. Only object names/types if >= 0, Scalars
  5679.                                and vectors are dumped if >= 1, Curves and
  5680.                                Surfaces are dumped if DumpLvl >= 2,
  5681.                                Polygons/lines are dumped if DumpLvl >= 3, and
  5682.                                List objects are traversed recursively if
  5683.                                DumpLvl >= 4.
  5684.     EchoSource    NumericType  If TRUE, irit scripts are echoed to stdout.
  5685.     FloatFrmt     StringType   Specifies a new printf floating point format.
  5686.     InterCrv      NumericType  If TRUE Boolean operations creates only
  5687.                                intersection curves. If FALSE, full Boolean
  5688.                                operation results.
  5689.     InterpProd    ConstantType  TRUE for Bspline sym. products via
  5690.                                interpolation FALSE for Bspline sym. products
  5691.                                via Bezier.
  5692.     PolySort      NumericType  Axis of Polygon Intersection sweep in Boolean
  5693.                                operations: 0 for X axis, 1 for Y axis, 2 for
  5694.                                Z axis.    
  5695.     PrimRatSrfs   NumericType  TRUE for rational exact primitive surfaces,
  5696.                                FALSE for approximated polynomial (integral)
  5697.                                surfaces.  See also PrimSrfs.
  5698.     PrimSrfs      NumericType  TRUE for primitive construction as freeform
  5699.                                surfaces, FALSE for polygonal primitives.
  5700.                                See also PrimRatSrfs.
  5701.     TrimCrvs      NumericType  Number of samples the higher order trimmed
  5702.                                curves are sampled, in piecewise linear
  5703.                                approximation.  If zero, computed
  5704.                                symbolically as composition.
  5705.     UVBoolean     NumericType  If TRUE, Boolean between surfaces returns UV
  5706.                                instead of Euclidean curves.
  5707.  
  5708.  
  5709.  Example:
  5710.  
  5711.     IRITSTATE( "DebugFunc", 3 );
  5712.     IRITSTATE( "FloatFrmt", "%8.5lg" );
  5713.  
  5714.  To print parameters of user defined functions on entry, and return value on
  5715.  exit. Also selects a floating point printf format of "%8.5lg".
  5716. $
  5717.  
  5718. INTERACT
  5719.  
  5720.  INTERACT( GeometryTreeType Object )
  5721.  
  5722.    A user-defined function (see iritinit.irt) that does the following,
  5723.  in order:
  5724.  Clear the display device.
  5725.  Display the given Object.
  5726.  Pause for a keystroke.
  5727.  
  5728.    This user-defined function in version 4.0 of IRIT is an
  5729.  emulation of the INTERACT function that used to exist in previous versions.
  5730.  
  5731.  Example:
  5732.  
  5733.  INTERACT( list( view_mat, Axes, Obj ) );
  5734.  
  5735.  displays and interacts with the object Obj and the predefined object
  5736.  Axes. VIEW_MAT will be used to set the starting transformation.
  5737.  
  5738.    See VIEW and VIEWOBJ for more.
  5739. $
  5740.  
  5741. LIST
  5742.  
  5743.  ListType LIST( AnyType Elem1, AnyType Elem2, ... )
  5744.  
  5745.    Constructs an object as a list of several other objects. Only a reference
  5746.  is made to the Elements, so modifying Elem1 after being included in the list
  5747.  will affect Elem1 in that list next time list is used!
  5748.  
  5749.    Each inclusion of an object in a list increases its internal used
  5750.  reference. The object is freed iff in used reference is zero.
  5751.    As a result, attempt to delete a variable (using FREE) which is referenced
  5752.  in a list removes the variable, but the object itself is freed only when the
  5753.  list is freed.
  5754. $
  5755.  
  5756. LOAD
  5757.  
  5758.  AnyType LOAD( StringType FileName )
  5759.  
  5760.    Loads an object from the given FileName. The object may be any object
  5761.  defined in the system, including lists, in which the structure is recovered
  5762.  and reconstructed as well (internal objects are inserted into the global
  5763.  system object list if they have names). If no file type is provided, ".dat"
  5764.  is assumed.
  5765.  
  5766.    This command can also be used to load binary files. Ascii regular data
  5767.  files are usually loaded in much more time then binary files due the 
  5768.  the parsing required. Binary data files can be loaded directly like ascii
  5769.  files in IRIT, but can only be inspected through IRIT tools such
  5770.  as dat2irit. A binary data file must have a ".bdt" (Binary DaTa) type in
  5771.  its name.
  5772.  
  5773.    Under unix, compressed files can be loaded if the given file name has
  5774.  a postfix of ".Z". The unix system's "zcat" will be invoked via a pipe
  5775.  for that purpose.
  5776. $
  5777.  
  5778. LOGFILE
  5779.  
  5780.  LOGFILE( NumericType Set )
  5781.  
  5782.  or
  5783.  
  5784.  LOGFILE( StringType FileName )
  5785.  
  5786.    If Set is non zero (see TRUE/FALSE and ON/OFF), then everything
  5787.  printed in the input window, will go to the log file specified in the
  5788.  IRIT.CFG configuration file. This file will be created the first time
  5789.  logfile is turned ON. If a string FileName is provided, it will
  5790.  be used as a log file name from now on. It also closes the current log
  5791.  file. A "LOGFILE( on );" must be issued after a log file name change.
  5792.  
  5793.  Example:
  5794.  
  5795.     LOGFILE( "Data1" );    
  5796.     LOGFILE( on );    
  5797.     printf( "Resolution = %lf\n", list( resolution ) );
  5798.     LOGFILE( off );    
  5799.  
  5800.  to print the current resolution level into file Data1.
  5801. $
  5802.  
  5803. MSLEEP
  5804.  
  5805.  MSLEEP( NumericType MilliSeconds )
  5806.  
  5807.  Causes the solid modeller to sleep for the prescribed time in milliseconds.
  5808.  
  5809.  Example:
  5810.  
  5811.  for ( i = 1, 1, sizeof( crvs ),
  5812.      c = nth( crvs, i ):
  5813.      color( c, yellow ):
  5814.      msleep(20):
  5815.      viewobj( c )
  5816.  );
  5817.  
  5818.  Displays an animation sequence and sleeps for 20 milliseconds between
  5819.  iterations.
  5820. $
  5821.  
  5822. NTH
  5823.  
  5824.  AnyType NTH( ListType ListObject, NumericType Index )
  5825.  
  5826.  Returns the Index (base count 1) element of the list ListObject.
  5827.  
  5828.  Example:
  5829.  
  5830.     Lst = list( a, list( b, c ), d );
  5831.     Lst2 = NTH( Lst, 2 );
  5832.  
  5833.  and now Lst2 is equal to 'list( b, c )'.
  5834. $
  5835.  
  5836. PAUSE
  5837.  
  5838.  PAUSE( NumericType Flush )
  5839.  
  5840.    Waits for a keystroke. Nice to have if a temporary stop in a middle of an
  5841.  included file (see INCLUDE) is required. If Flush is TRUE, then the input
  5842.  is first flushed to guarantee that the actual stop will occur.
  5843. $
  5844.  
  5845. PRINTF
  5846.  
  5847.  PRINTF( StringType CtrlStr, ListType Data )
  5848.  
  5849.  A formatted printing routine, following the concepts of the C programming
  5850.  language's printf routine. CtrlStr is a string object for which
  5851.  the following special '%' commands are supported:
  5852.  
  5853.     %d, %i, %u      Prints the numeric object as an integer or unsigned integer.
  5854.     %o, %x, %X      Prints the numeric object as an octal or hexadecimal integer.
  5855.     %e, %f, %g,     Prints the numeric object in several formats of
  5856.     %E, %F          floating point numbers.
  5857.     %s              Prints the string object as a string.
  5858.     %pe, %pf, %pg   Prints the three coordinates of the point object.
  5859.     %ve, %vf, %vg   Prints the three coordinates of the vector object.
  5860.     %Pe, %Pf, %Pg,  Prints the four coordinates of the plane object.
  5861.     %De, %Df, %Dg,  Prints the given object in IRIT's data file format.
  5862.  
  5863.  
  5864.  All the '%' commands can include any modifier that is valid in the C
  5865.  programming language printf routine, including l (long), prefix
  5866.  character(s), size, etc. The point, vector, plane, and object commands
  5867.  can also be modified in a similar way, to set the format of the
  5868.  numeric data printed.
  5869.  
  5870.  Also supported are the newline and tab using the backslash escape
  5871.  character:
  5872.  
  5873.  PRINTF("\\tThis is the char \"\\%\"\\n", nil());
  5874.  
  5875.  Backslashes should be escaped themselves as can be seen in the above example.
  5876.  Here are few more examples:
  5877.  
  5878.  PRINTF("this is a string \"%s\" and this is an integer %8d.\\n",
  5879.        list("STRING", 1987));
  5880.  PRINTF("this is a vector [%8.5lvf]\\n", list(vector(1,2,3)));
  5881.  IritState("DumpLevel", 9);
  5882.  PRINTF("this is a object %8.6lDf...\\n", list(axes));
  5883.  PRINTF("this is a object %10.8lDg...\\n", list(axes));
  5884.  
  5885.  This implementation of PRINTF is somewhat different than the C programming
  5886.  language's version, because the backslash always escapes the next
  5887.  character during the processing stage of IRIT's parser. That is, the string
  5888.  
  5889.         '\\tThis is the char \"\\%\"\\n'
  5890.  
  5891.  is actually parsed by the IRIT's parser into
  5892.  
  5893.         '\tThis is the char "\%"\n'
  5894.  
  5895.  because this is the way the IRIT parser processes strings. The latter
  5896.  string is the one that PRINTF actually see.
  5897. $
  5898.  
  5899. PROCEDURE
  5900.  
  5901.  ProcName = PROCEDURE(Prm1, Prm2, ... , PrmN):LclVal1:LclVar2: ... :LclVarM:
  5902.      ProcBody;
  5903.  
  5904.  A procedure is a function that does not return a value, and therefore the
  5905.  return variable (see FUNCTION) should not be used. A procedure is
  5906.  identical to a function in every other way. See FUNCTION for more.
  5907. $
  5908.  
  5909. RMATTR
  5910.  
  5911.  RMATTR( AnyType Object, StringType Name )
  5912.  
  5913.    Removes attribute named Name from object Object. This function
  5914.  will have no affect on Object if Object have no attribute named
  5915.  Name.
  5916.  
  5917.  See also ATTRIB.
  5918. $
  5919. SAVE
  5920.  
  5921.  SAVE( StringType FileName, AnyType Object )
  5922.  
  5923.    Saves the provided Object in the specified file name FileName.
  5924.  No extension type is needed (ignored if specified), and ".dat" is supplied
  5925.  by default. Object can be any object type, including list, in which
  5926.  structure is saved recursively. See also LOAD. If a display device is
  5927.  actively running at the time SAVE is invoked, its transformation matrix
  5928.  will be saved with the same name but with extension type of ".mat" instead
  5929.  of ".dat".
  5930.  
  5931.    This command can also be used to save binary files. Ascii regular data
  5932.  files are usually loaded in much more time then binary files due the 
  5933.  the parsing required. Binary data files can be loaded directly like ascii
  5934.  files in IRIT, but must be inspected through IRIT tools such
  5935.  as dat2irit. A binary data file must have a ".bdt" (Binary DaTa) type in
  5936.  its name.
  5937.  
  5938.    Under unix, files will be saved compressed if the given file name has
  5939.  a postfix of ".Z". The unix system's "compress" will be invoked via a pipe
  5940.  for that purpose.
  5941.  
  5942.    Example:
  5943.  
  5944.  SAVE( "Obj1.bdt.Z", Obj1 );
  5945.  
  5946.  Saves Obj1 in the file Obj1.bdt.Z as compressed binary file.
  5947. $
  5948.  
  5949. SNOC
  5950.  
  5951.  SNOC( AnyType Object, ListType ListObject )
  5952.  
  5953.    Similar to the lisp cons operator but puts the new Object in the
  5954.  end of the list ListObject instead of the beginning, in place.
  5955.  
  5956.  Example:
  5957.  
  5958.     Lst = list( axes );
  5959.     SNOC( Srf, Lst );
  5960.  
  5961.  and now Lst is equal to the list 'list( axes, Srf )'.
  5962. $
  5963.  
  5964. SYSTEM
  5965.  
  5966.  SYSTEM( StringType Command )
  5967.  
  5968.    Executes a system command Command. For example,
  5969.  
  5970.     SYSTEM( "ls -l" );
  5971. $
  5972.  
  5973. TIME
  5974.  
  5975.  TIME( NumericType Reset )
  5976.  
  5977.    Returns the time in seconds from the last time TIME was called with
  5978.  Reset TRUE. This time is CPU time if such support is available
  5979.  from the system (times function), and is real time otherwise (time
  5980.  function).
  5981.    The time is automatically reset at the beginning of the execution of this
  5982.  program.
  5983.  
  5984.  Example:
  5985.  
  5986.     Dummy = TIME( TRUE );
  5987.       .
  5988.       .
  5989.       .
  5990.     TIME( FALSE );
  5991.  
  5992.  prints the time in seconds between the above two time function calls.
  5993. $
  5994.  
  5995. VARLIST
  5996.  
  5997.  VARLIST()
  5998.  
  5999.    List all the currently defined objects in the system.
  6000. $
  6001.  
  6002. VECTOR
  6003.  
  6004.  VectorType VECTOR( NumericType X, NumericType Y, NumericType Z )
  6005.  
  6006.    Creates a vector type object, using the three provided NumericType scalars.
  6007. $
  6008.  
  6009. VIEW
  6010.  
  6011.  VIEW( GeometricTreeType Object, NumericType ClearWindow )
  6012.  
  6013.    Displays the (geometric) object(s) as given in Object.
  6014.  
  6015.    If ClearWindow is non-zero (see TRUE/FALSE and ON/OFF) the window is
  6016.  first cleared (before drawing the objects).
  6017.  
  6018.  Example:
  6019.  
  6020.     VIEW( Axes, FALSE );
  6021.  
  6022.  displays the predefined object Axes in the viewing window on top of
  6023.  what is drawn already.
  6024.  
  6025.  In version 4.0, this function is emulated (see iritinit.irt) using the
  6026.  VIEWOBJ function. In order to use the current viewing matrix, VIEW_MAT
  6027.  should be provided as an additional parameter. For example,
  6028.  
  6029.     VIEW( list( view_mat, Obj ), TRUE );
  6030.  
  6031.  However, since VIEW is a user defined function, the following will not
  6032.  use VIEW_MAT as one would expect:
  6033.  
  6034.     VIEW( view_mat, TRUE );
  6035.  
  6036.  because VIEW_MAT will be renamed inside the VIEW user defined function to
  6037.  a local (to the user defined function) variable.
  6038.  
  6039.  In iritinit.irt one can find several other useful VIEW related functions:
  6040.  
  6041.     VIEWCLEAR       Clears all data displayed on the display device.
  6042.     VIEWREMOVE      Removes the object specified by name from display.
  6043.     VIEWDISC        Disconnects from display device (which is still running)
  6044.                     while allowing IRIT to connect to a new device.
  6045.     VIEWEXIT        Forces the display device to exit.
  6046.     VIEWSAVE        Request sdisplay device to save transformation matrix.
  6047.     BEEP            An emulation of the BEEP command of versions prior to 4.0.
  6048.     VIEWSTATE       Allows to change the state of the display device.
  6049.  
  6050.  
  6051.    For the above VIEW related functions, only VIEWREMOVE, VIEWSAVE, and
  6052.  VIEWSTATE require a parameter, which is the file name and view state
  6053.  respectively. The view state can be one of several commands. See the
  6054.  display device section for more.
  6055.  
  6056.  Examples:
  6057.  
  6058.     VIEWCLEAR();
  6059.     VIEW( axes, off );
  6060.     VIEWSTATE( "LngrVecs" );
  6061.     VIEWSTATE( "DrawSolid" );
  6062.     VIEWSAVE( "matrix1" );
  6063.     VIEWREMOVE( "axes" );
  6064.     VIEWDISC();
  6065. $
  6066.  
  6067. VIEWOBJ
  6068.  
  6069.  VIEWOBJ( GeometricTreeType Object )
  6070.  
  6071.    Displays the (geometric) object(s) as given in Object.
  6072.  Object may be any GeometricType or a list of other
  6073.  GeometricTypes nested to an arbitrary level.
  6074.  
  6075.    Unlike IRIT versions prior to 4.0, VIEW_MAT is not explicitly used
  6076.  as the transformation matrix. In order to display with a VIEW_MAT view,
  6077.  VIEW_MAT should be listed as an argument (in that exact name) to
  6078.  VIEWOBJ. Same is true for the perspective matrix PRSP_MAT.
  6079.  
  6080.  Example:
  6081.  
  6082.     VIEWOBJ( list( view_mat, Axes ) );
  6083.  
  6084.  displays the predefined object Axes in the viewing window using the
  6085.  viewing matrix VIEW_MAT.
  6086. $
  6087.  
  6088. WHILE
  6089.  
  6090.  WHILE( NumericType Cond, AnyType Body )
  6091.  
  6092.    Executes the Body (see below), while the WHILE loop conditions
  6093.  Cond is evaluated into a non zero value. Cond is being
  6094.  evaluated before each iteration.
  6095.  
  6096.    The body may consist of any number of regular commands, separated by
  6097.  COLONs, including nesting loops to an arbitrary level.
  6098.  
  6099.  Example:
  6100.  
  6101.  deg = 0;
  6102.  rotstepx = rotx( 10 );
  6103.  WHILE ( deg < 360,
  6104.      deg = deg + 10:
  6105.      view_mat = rotstepx * view_mat:
  6106.      view( list( view_mat, axes ), ON )
  6107.  );
  6108.  
  6109.  Displays axes with a view direction that is rotated 10 degrees at a
  6110.  time around the X axis.
  6111. $
  6112.  
  6113.  
  6114. System variables
  6115. $
  6116.  
  6117.  System variables are predefined objects in the system. Any time IRIT is
  6118.  executed, these variable are automatically defined and set to values which
  6119.  are sometimes machine dependent. These are regular objects in any other
  6120.  sense, including the ability to delete or overwrite them. One can modify,
  6121.  delete, or introduce other objects using the IRITINIT.IRT file.
  6122.  
  6123. AXES
  6124.    Predefined polyline object (PolylineType) that describes the XYZ axes.
  6125. $
  6126.  
  6127. DRAWCTLPT
  6128.    Predefined Boolean variable (NumericType) that controls whether curves'
  6129.  control polygons and surfaces' control meshes are drawn (TRUE) or not
  6130.  (FALSE). Default is FALSE.
  6131. $
  6132.  
  6133. FLAT4PLY
  6134.    Predefined Boolean object (NumericType) that controls the way almost flat
  6135.  surface patches are converted to polygons: four polygons (TRUE) or only
  6136.  two polygons (FALSE). Default value is FALSE.
  6137. $
  6138.  
  6139. MACHINE
  6140.    Predefined numeric object (NumericType) holding the machine type as one of
  6141.  the following constants: MSDOS, SGI, HP, SUN, APOLLO, UNIX, IBMOS2, IBMNT,
  6142.  and AMIGA.
  6143. $
  6144.  
  6145. POLY_APPROX_OPT
  6146.    A variable controlling the algorithm to convert surfaces to polygons.
  6147.    This two digit number controls the method that is used to subdivide a
  6148.  surface into polygons.
  6149.    The first digit (units) can be one of:
  6150.  
  6151.     0    Uniform sampling in a fixed grid.
  6152.     1    An alternated U and V subdivision direction. Once U is
  6153.          subdivided and then V is subdivided.
  6154.     2    A min max subdivision direction. In other words, the
  6155.          direction that minimizes the maximal error is selected.
  6156.  
  6157.  
  6158.    The second digit (tenths) can be one of:
  6159.  
  6160.     0    A fixed sized regular grid. The side of the grid is set
  6161.          via the RESOLUTION variable.
  6162.     1    This mode is not for general use.
  6163.     2    Maximal distance between the surface and its polygonal
  6164.          approximation is bounded by bilinear surface fit.
  6165.          Maximal distance allowed is set via POLY_APPROX_TOL.
  6166.          Recommended choice for optimal polygonization.
  6167.     3    This mode is not for general use.
  6168.  
  6169. $
  6170.  
  6171. POLY_APPROX_UV
  6172.    A Boolean predefined variable. If TRUE, UV values of surface polygonal
  6173.  approximation are placed on attribute lists of vertices.
  6174. $
  6175.  
  6176. POLY_APPROX_TOL
  6177.    A numeric predefined tolerance control on the distance between the surface
  6178.  and its polygonal approximation in POLY_APPROX_OPT settings.
  6179. $
  6180.  
  6181. PRSP_MAT
  6182.    Predefined matrix object (MatrixType) to hold the perspective matrix
  6183.  used/set by VIEW and/or INTERACT commands. See also VIEW_MAT.
  6184. $
  6185.  
  6186. RESOLUTION
  6187.    Predefined numeric object (NumericType) that sets the accuracy of the
  6188.  polygonal primitive geometric objects and the approximation of curves and
  6189.  surfaces. Holds the number of divisions a circle is divided into (with
  6190.  minimum value of 4). If, for example, RESOLUTION is set to 6, then a
  6191.  generated CONE will effectively be a six-sided pyramid.
  6192.    Also controls the fineness of freeform curves and surfaces when they are
  6193.  approximated as piecewise linear polylines, and the fineness of freeform
  6194.  surfaces when they are approximated as polygons.
  6195. $
  6196.  
  6197. VIEW_MAT
  6198.    Predefined matrix object (MatrixType) to hold the viewing matrix used/set
  6199.  by VIEW and/or INTERACT commands. See also PRSP_MAT.
  6200. $
  6201.  
  6202. System constants
  6203.  
  6204.  The following constants are used by the various functions of the system to
  6205.  signal certain conditions. Internally, they are represented numerically,
  6206.  although, in general, their exact value is unimportant and may be changed
  6207.  in future versions. In the rare circumstance that  you need to know their
  6208.  values, simply type the constant as an expression.
  6209.  
  6210.  Example:
  6211.  
  6212.     MAGENTA;
  6213.  
  6214. $
  6215.  
  6216. AMIGA
  6217.  A constant designating an AMIGA system, in the MACHINE variable.
  6218. $
  6219.  
  6220. APOLLO
  6221.  A constant designating an APOLLO system, in the MACHINE variable.
  6222. $
  6223.  
  6224. BLACK
  6225.  A constant defining a BLACK color.
  6226. $
  6227.  
  6228. BLUE
  6229.  A constant defining a BLUE color.
  6230. $
  6231.  
  6232. COL
  6233.  A constant defining the COLumn or U direction of a surface or a
  6234.  trivariate mesh.
  6235. $
  6236.  
  6237. CTLPT_TYPE
  6238.  A constant defining an object of type control point.
  6239. $
  6240.  
  6241. CURVE_TYPE
  6242.  A constant defining an object of type curve.
  6243. $
  6244.  
  6245. CYAN
  6246.  A constant defining a CYAN color.
  6247. $
  6248.  
  6249. DEPTH
  6250.   A constant defining the DEPTH direction of a trivariate mesh.
  6251.  See TBEZIER, TBSPLINE.
  6252. $
  6253.  
  6254. E1
  6255.  A constant defining an E1 (X only coordinate) control point type.
  6256. $
  6257.  
  6258. E2
  6259.  A constant defining an E2 (X and Y coordinates) control point type.
  6260. $
  6261.  
  6262. E3
  6263.  A constant defining an E3 (X, Y and Z coordinates) control point type.
  6264. $
  6265.  
  6266. E4
  6267.  A constant defining an E4 control point type.
  6268. $
  6269.  
  6270. E5
  6271.  A constant defining an E5 control point type.
  6272. $
  6273.  
  6274. FALSE
  6275.  A zero constant. May be used as Boolean operand.
  6276. $
  6277.  
  6278. GREEN
  6279.  A constant defining a GREEN color.
  6280. $
  6281.  
  6282. HP
  6283.  A constant designating an HP system, in the MACHINE variable.
  6284. $
  6285.  
  6286. IBMOS
  6287.  A constant designating an IBM system running under OS2, in the MACHINE
  6288.  variable.
  6289. $
  6290.  
  6291. IBMNT
  6292.  A constant designating an IBM system running under Windows NT, in the MACHINE
  6293.  variable.
  6294. $
  6295.  
  6296. KV_FLOAT
  6297.  A constant defining a floating end condition uniformly spaced knot vector.
  6298. $
  6299.  
  6300. KV_OPEN
  6301.  A constant defining an open end condition uniformly spaced knot vector.
  6302. $
  6303.  
  6304. KV_PERIODIC
  6305.  A constant defining a periodic end condition with uniformly spaced knot
  6306.  vector.
  6307. $
  6308.  
  6309. LIST_TYPE
  6310.  A constant defining an object of type list.
  6311. $
  6312.  
  6313. MAGENTA
  6314.  A constant defining a MAGENTA color.
  6315. $
  6316.  
  6317. MATRIX_TYPE
  6318.  A constant defining an object of type matrix.
  6319. $
  6320.  
  6321. MSDOS
  6322.  A constant designating an MSDOS system, in the MACHINE variable.
  6323. $
  6324.  
  6325. NUMERIC_TYPE
  6326.  A constant defining an object of type numeric.
  6327. $
  6328.  
  6329. OFF
  6330.  Synonym of FALSE.
  6331. $
  6332.  
  6333. ON
  6334.  Synonym for TRUE.
  6335. $
  6336.  
  6337. P2
  6338.  A constant defining a P1 (W and WX coordinates, in that order) rational
  6339.  control point type.
  6340. $
  6341.  
  6342. P2
  6343.  A constant defining a P2 (W, WX, and WY coordinates, in that order) rational
  6344.  control point type.
  6345. $
  6346.  
  6347. P3
  6348.  A constant defining a P3 (W, WX, WY, and WZ coordinates, in that order)
  6349.  rational control point type.
  6350. $
  6351.  
  6352. P4
  6353.  A constant defining a P4 rational control
  6354.  point type.
  6355. $
  6356.  
  6357. P5
  6358.  A constant defining a P5 rational control
  6359.  point type.
  6360. $
  6361.  
  6362. PARAM_CENTRIP
  6363.  A constant defining a centripetal length parametrization.
  6364. $
  6365.  
  6366. PARAM_CHORD
  6367.  A constant defining a chord length parametrization.
  6368. $
  6369.  
  6370. PARAM_UNIFORM
  6371.  A constant defining an uniform parametrization.
  6372. $
  6373.  
  6374. PI
  6375.  The constant of 3.141592...
  6376. $
  6377.  
  6378. PLANE_TYPE
  6379.  A constant defining an object of type plane.
  6380. $
  6381.  
  6382. POINT_TYPE
  6383.  A constant defining an object of type point.
  6384. $
  6385.  
  6386. POLY_TYPE
  6387.  A constant defining an object of type poly.
  6388. $
  6389.  
  6390. RED
  6391.  A constant defining a RED color.
  6392. $
  6393.  
  6394. ROW
  6395.   A constant defining the ROW or V direction of a surface or a trivariate mesh.
  6396. $
  6397.  
  6398. SGI
  6399.  A constant designating an SGI system, in the MACHINE variable.
  6400. $
  6401.  
  6402. STRING_TYPE
  6403.  A constant defining an object of type string.
  6404. $
  6405.  
  6406. SURFACE_TYPE
  6407.  A constant defining an object of type surface.
  6408. $
  6409.  
  6410. SUN
  6411.  A constant designating a SUN system, in the MACHINE variable.
  6412. $
  6413.  
  6414. TRIMSRF_TYPE
  6415.  A constant defining an object of type trimmed surface.
  6416. $
  6417.  
  6418. TRIVAR_TYPE
  6419.  A constant defining an object of type trivariate function.
  6420. $
  6421.  
  6422. TRUE
  6423.  A non zero constant. May be used as Boolean operand.
  6424. $
  6425.  
  6426. UNDEF_TYPE
  6427.  A constant defining an object of no type (yet).
  6428. $
  6429.  
  6430. UNIX
  6431.  A constant designating a generic UNIX system, in the MACHINE variable.
  6432. $
  6433.  
  6434. VECTOR_TYPE
  6435.  A constant defining an object of type vector.
  6436. $
  6437.  
  6438. WHITE
  6439.  A constant defining a WHITE color.
  6440. $
  6441.  
  6442. YELLOW
  6443.  A constant defining a YELLOW color.
  6444. $
  6445.  
  6446.  
  6447. Animation
  6448.  
  6449.  The animation tool adds the capability of animating objects using
  6450.  forward kinematics, exploiting animation curves.  Each object has
  6451.  different attributes, that prescribe its motion, scale, and visibility
  6452.  as a function of time. Every attribute has a name, which designates
  6453.  it's role. For instance an attribute animation curve named MOV_X
  6454.  describes a translation motion along the X axis.
  6455.  
  6456.  
  6457.  Let OBJ be an object in IRIT to animate.
  6458.  
  6459.  Animation curves are either scalar (E1/P1) curves or three dimensional
  6460.  (E3/P3) curves with one of the following name prefixes:
  6461.  
  6462.      MOV_X, MOV_Y, MOV_Z            Translation along one axis 
  6463.      MOV_XYZ                        Arbitrary translation along all three axes
  6464.      ROT_X, ROT_Y, ROT_Z            Rotating around a single axis (degrees)
  6465.      SCL_X, SCL_Y, SCL_Z            Scale along a single axis  
  6466.      SCL                            Global scale               
  6467.      VISIBLE                        Visibility                 
  6468.  
  6469.  
  6470.  The visibility curve is a scalar curve that enables the display of
  6471.  the object if the visibility curve is positive at time t and disables
  6472.  the display (hide) the object if the visibility curve is negative at
  6473.  time t.
  6474.  
  6475.  The animation curves are all attached as an attribute named "animation"
  6476.  to the object OBJ.
  6477.  
  6478.  Example:
  6479.     mov_x = cbezier( ctlpt( E1, 0.0 ),
  6480.                      ctlpt( E1, 1.0 ) );
  6481.     scl   = cbezier( ctlpt( E1, 1.0 ),
  6482.                      ctlpt( E1, 0.1 ) );
  6483.     rot_y = cbezier( ctlpt( E1, 0.0 ),
  6484.                      ctlpt( E1, 0.0 ) );
  6485.                      ctlpt( E1, 360.0 ) );
  6486.     attrib(OBJ, "animation", list( mov_x, scl, rot_y ) );
  6487.  
  6488.  To animate OBJ between time zero and one (Bezier curves are always
  6489.  between zero and one), by moving it a unit size in the X direction,
  6490.  scaling it to %10 of its original size and rotating it at increasing
  6491.  angular speed from zero to 360 degrees.
  6492.  
  6493.  OBJ can now be save into a file or displayed via one of the regular
  6494.  viewing commands in IRIT (i.e. VIEWOBJ).
  6495.  
  6496.  Animation is not always between zero and one. To that end, one can
  6497.  apply the CREPARAM function to modify the parametric domain of the
  6498.  animation curve. The convention is that if the time is below the
  6499.  starting value of the parametric domain, the starting value of the
  6500.  curve is used.  Similarly if the time is beyond the end of the
  6501.  parameter domain of the animation curve, the end value of the
  6502.  animation curve is used.
  6503.  
  6504.  Example:
  6505.     CREPARAM( mov_x, 3.0, 5.0 );
  6506.  
  6507.  to set the time of the motion in the x axis to be from t = 3 to
  6508.  t = 5.  for t < 3, mov_x(3) is used, and for t > 5, mov_x(5) is
  6509.  employed.
  6510.  
  6511.  the animation curves are regular objects in the IRIT system. Hence,
  6512.  only one object named mov_x or scl can exist at one time. If you
  6513.  create a new object named mov_x, the old one is overwritten! To
  6514.  preserve old animation curves you can detach the old ones by executing
  6515.  'free(mov_x)' that removes the object named mov_x from IRIT's object
  6516.  list but not from its previous used locations within other list
  6517.  objects, if any.  A different way to it call this animation curves
  6518.  mov_x1, mov_x2 etc. as only the prefix of the name is verified.
  6519.  
  6520.  For example:
  6521.  
  6522.     mov_x = cbezier( ctlpt( E1, 0.0 ),
  6523.                      ctlpt( E1, 1.0 ) );
  6524.     attrib(obj1, "animation", list( mov_x ) );
  6525.     free(mov_x);
  6526.  
  6527.     mov_x1 = cbezier( ctlpt( E1, 2.0 ),
  6528.                       ctlpt( E1, 3.0 ) );
  6529.     mov_x2 = cbezier( ctlpt( E1, 2.0 ),
  6530.                       ctlpt( E1, 3.0 ) );
  6531.     attrib(obj2, "animation", list( mov_x1, mov_x2 ) );
  6532.     free(mov_x);
  6533.  
  6534.  notice the way we have two animation curves translating obj2 in x.
  6535.  This is somewhat artificial but might make more sense if other
  6536.  transformations would appear in between.
  6537.  
  6538.  
  6539.   a = box( vector( 0, 0, 0 ), 1, 1, 1 );
  6540.   b = box( vector( 0, 0, 0 ), 1, 1, 1 );
  6541.   c = box( vector( 0, 0, 0 ), 1, 1, 1 );
  6542.   d = sphere( vector( 0, 0, 0), 0.7 );
  6543.   
  6544.   pt0   =  ctlpt( e1,  0.0 );
  6545.   pt1   =  ctlpt( e1,  1.0 );
  6546.   pt2   =  ctlpt( e1,  2.0 );
  6547.   pt6   =  ctlpt( e1,  6.0 );
  6548.   pt360 =  ctlpt( e1,  360.0 );
  6549.   
  6550.   pt10 = ctlpt( e1, -4.0 );
  6551.   pt11 = ctlpt( e1,  1.0 );
  6552.   pt12 = ctlpt( e1,  4.0 );
  6553.   pt13 = ctlpt( e1, -1.0 );
  6554.   
  6555.   visible = creparam( cbezier( list( pt10,  pt11 ) ), 0.0, 5.0 );
  6556.   mov_x   = creparam( cbezier( list( pt0, pt6, pt2 ) ), 0.0, 1.2 );
  6557.   mov_y   = mov_x;
  6558.   mov_z   = mov_x;
  6559.   rot_x   = creparam( cbspline( 2,
  6560.                                 list( pt0, pt360, pt0 ),
  6561.                                 list( KV_OPEN ) ),
  6562.                       1.2, 2.5 ); 
  6563.   rot_y   = rot_x;
  6564.   rot_z   = rot_x;
  6565.   scl     = creparam( cbezier( list( pt1, pt2, pt1, pt2, pt1 ) ),
  6566.                       2.5, 4.0 );
  6567.   scl_x   = scl;
  6568.   scl_y   = scl;
  6569.   scl_z   = scl;
  6570.   mov_xyz = creparam( circle( vector( 0, 0, 0 ), 2.0 ), 4.0, 5.0 );
  6571.   
  6572.   attrib( d, "animation", list( mov_xyz, visible ) );
  6573.   free( visible );
  6574.   
  6575.   visible = creparam( cbezier( list( pt12,  pt13 ) ), 0.0, 5.0 );
  6576.   
  6577.   attrib( a, "animation", list( rot_x, mov_x, scl, scl_x, visible ) );
  6578.   attrib( b, "animation", list( rot_y, mov_y, scl, scl_y, visible ) );
  6579.   attrib( c, "animation", list( rot_z, mov_z, scl, scl_z, visible ) );
  6580.   
  6581.   color( a, red );
  6582.   color( b, green );
  6583.   color( c, blue );
  6584.   color( d, cyan );
  6585.   
  6586.   demo = list( a, b, c, d );
  6587.   
  6588.   interact( demo );
  6589.   viewanim( 0, 5, 0.01 );
  6590.  
  6591.  In this example, we create four objects, three cubes and one sphere.
  6592.  Animation curves to translate the three cubes along the three axes for
  6593.  the time period of t = 0 to t = 1.2 are created. Rotation curves to
  6594.  rotate the three cubes along the three axes are then created for time
  6595.  period of t = 1.2 to t = 2.5. Finally, for the time period of t = 2.5
  6596.  to t = 4.0. the cubes are (not only) unifomly scaled. For the time
  6597.  period of t = 4 to t = 5, the cubes become invisible and the sphere,
  6598.  that becomes visible, is rotated along a circle of radius 2.
  6599.  
  6600.  
  6601.   This example demonstrates the ability to put "animation" attributes
  6602.  on internal nodes of a hierarchy, affecting the entire set of objects
  6603.  in the hierachy.   Herein, we present an robotic arm with three edges
  6604.  and two joints.
  6605.  
  6606.     BoxLength = 2;
  6607.     BoxWidth = 2;
  6608.     BoxHeight = 10;
  6609.     
  6610.     LowerBox = box( vector( -BoxLength / 2, -BoxWidth / 2, 0 ),
  6611.                     BoxLength, BoxWidth, BoxHeight);
  6612.     MiddleBox = box( vector( -BoxLength / 2, -BoxWidth / 2, 0 ),
  6613.                      BoxLength, BoxWidth, BoxHeight);
  6614.     UpperBox = box( vector( -BoxLength / 2, -BoxWidth / 2, 0 ),
  6615.                     BoxLength, BoxWidth, BoxHeight);
  6616.     Cn1 = cone( vector( 0, 0, 0 ), vector( 0, BoxHeight / 3, 0 ), 1 );
  6617.     
  6618.     color( LowerBox, magenta );
  6619.     color( MiddleBox, yellow );
  6620.     color( UpperBox, cyan );
  6621.     color( Cn1, green );
  6622.     
  6623.     rot_x1 = creparam( cbspline( 3,
  6624.                                  list( ctlpt( E1,  0 ),
  6625.                                        ctlpt( E1,  -200 ),
  6626.                                        ctlpt( E1,  200 ),
  6627.                                               ctlpt( E1,  0 ) ),
  6628.                                  list( KV_OPEN ) ),
  6629.                        0, 3 );
  6630.     rot_x2 = creparam( cbspline( 4,
  6631.                                  list( ctlpt( E1,  0 ),
  6632.                                        ctlpt( E1,  400 ),
  6633.                                        ctlpt( E1,  -400 ),
  6634.                                               ctlpt( E1,  0 ) ),
  6635.                                  list( KV_OPEN ) ),
  6636.                        0, 3 );
  6637.     rot_y = creparam( cbspline( 2,
  6638.                                 list( ctlpt( E1,  0 ),
  6639.                                       ctlpt( E1,  100 ),
  6640.                                       ctlpt( E1, -100 ),
  6641.                                       ctlpt( E1,  0 ) ),
  6642.                                 list( KV_OPEN ) ),
  6643.                       0, 3 );
  6644.     rot_z = creparam( cbspline( 2,
  6645.                                 list( ctlpt( E1,  0 ),
  6646.                                       ctlpt( E1,  1440 ) ),
  6647.                                 list( KV_OPEN ) ),
  6648.                       0, 3 );
  6649.     Translate = trans( vector( 0, 0, BoxHeight ) );
  6650.     
  6651.     attrib( Cn1, "animation", list( rot_z, Translate ) );
  6652.     
  6653.     Upr = list( Cn1, UpperBox );
  6654.     attrib( Upr, "animation", list( rot_y, Translate ) );
  6655.     
  6656.     Mid = list( Upr, MiddleBox );
  6657.     attrib( Mid, "animation", list( rot_x2, Translate ) );
  6658.     
  6659.     rbt_hand = list( Mid, LowerBox );
  6660.     attrib( rbt_hand, "animation", list( rot_x1 ) );
  6661.     
  6662.     view( rbt_hand, 1 );
  6663.  
  6664.  In this example, we create four objects, three cubes and one cone,
  6665.  simulating a robotic hand with three edges an a gripper (the cone).
  6666.  The animation is define hierarchically, making it very easy to model
  6667.  the robot.
  6668. $
  6669.  
  6670.  
  6671. Display devices
  6672.  
  6673.  The following display device drivers are available,
  6674.  
  6675.     Device Name            Invocation             Environment        
  6676.                                                                      
  6677.     xgldrvs                xgldrvs -s-            SGI 4D GL regular driver.
  6678.     xogldrvs               xogldrvs -s-           SGI 4D Open GL/Motif driver.
  6679.     xgladap                xgladap -s-            SGI 4D GL adaptive isocurve
  6680.                                                   experimental driver.
  6681.     x11drvs                x11drvs -s-            X11 driver.        
  6682.     xmtdrvs                xmtdrvs -s-            X11 Motif driver.  
  6683.     xglmdrvs               xglmdrvs -s-           SGI 4D GL and X11/Motif driver.
  6684.     wntdrvs                wntdrvs -s-            IBM PC Windows NT driver.
  6685.     wntgdrvs               wntgdrvs -s-           IBM PC Windows NT Open GL driver.
  6686.     os2drvs                os2drvs -s-            IBM PC OS2 2.x/3.x driver.
  6687.     amidrvs                amidrvs -s-            AmigaDOS 2.04+ driver.
  6688.     nuldrvs                nuldrvs -s- [-d] [-D]   A device to print the
  6689.                                                   object stream to stdout.
  6690.  
  6691.  
  6692.  All display devices are clients communicating with the server (IRIT)
  6693.  using IPC (inter process communication). On Unix and Window NT sockets are
  6694.  used. A Windows NT client can talk to a server (IRIT) on a unix host if
  6695.  hooked to the same netwrok. On OS2 pipes are used, and both the client and
  6696.  server must run on the same machine. On AmigaDOS exec messages are used,
  6697.  and both the client and server must run on the same machine.
  6698.  
  6699.    While all display devices support object(s) transformations via a
  6700.  transformation control window, many of the display devices allow one
  6701.  to click and drag on the viewing window to rotate (Left Button) and
  6702.  to translate (Right Button).  This mode exploits the two degrees of
  6703.  freedom of the mouse to provide intuitive dual axis rotation and
  6704.  translation.
  6705.  
  6706.    The server (IRIT) will automatically start a client display device
  6707.  if the IRIT_DISPLAY environment variable is set to the name and options of
  6708.  the display device to run. For example:
  6709.  
  6710.     setenv IRIT_DISPLAY xgldrvs -s-
  6711.  
  6712.    The display device must be in a directory that is in the path
  6713.  environment variable. Most display devices require the '-s-' flags to run
  6714.  in a non-standalone mode, or a client-server mode. Most drivers can also
  6715.  be used to display data in a standalone mode (i.e., no server). For
  6716.  example:
  6717.  
  6718.     xgldrvs -s solid1.dat irit.mat
  6719.  
  6720.     Effectively, all the display devices are also data display programs
  6721.  (poly3d, which was the display program prior to version 4.0, is retired
  6722.  in 4.0). Therefore some functionality is not always as expected. For
  6723.  example, the quit button will always force the display device to quit,
  6724.  even if poped up from IRIT, but will not cause IRIT to
  6725.  quit as might logically expected. In fact, the next time IRIT will
  6726.  try to communicate with the display device, it will find the broken
  6727.  connection and will start up a new display device.
  6728.  
  6729.     Most display devices recognize attributes found on objects. The following
  6730.  attributes are usually recognized (depending on the device capability.):
  6731.  
  6732.   COLOR: Selects the drawn color of the object to be one of the 8/16
  6733.         predefined colors in the IRIT system: white, red, green, blue,
  6734.         yellow, cyan, magenta, black.
  6735.   RGB: Overwrites (if supported) the COLOR attribute (if given) and
  6736.         sets the color of the object to the exact prescribed RGB set.
  6737.   DWIDTH: Sets the width in pixels of the drawn object, when drawn as
  6738.         a wireframe.
  6739.  
  6740.     All display devices recognize all the command line flags and all the
  6741.  configuration options in a configuration file, as described below. The display
  6742.  devices will make attemps to honor the requests, to the best of their ability.
  6743.     For example, only xgldrvs can render shaded models, and so only it will
  6744.  honor a DrawSolid configuration options.
  6745.  
  6746.  
  6747.  ???drvs [-s] [-u] [-n] [-N] [-i] [-c] [-C] [-m] [-a] [-g x1,x2,y1,y2]
  6748.          [-G x1,x2,y1,y2] [-I #IsoLines] [-F PolygonOpti FineNess] 
  6749.          [-f PolylineOpti SampTol] [-l LineWidth] [-r] [-A Shader] [-B]
  6750.          [-2] [-d] [-D] [-L NormalLen] [-4] [-b BackGround] [-S LgtSrcPos]
  6751.          [-Z ZMin ZMax] [-M] [-P] [-x ExecAnimCmd] [-X Min,Max,Dt{,flags}]
  6752.          [-z] DFiles
  6753.  
  6754.   -s: Runs the driver in a Standalone mode. Otherwise, the driver will
  6755.         attempt to communicate with the IRIT server.
  6756.   -u: Forces a Unit matrix. That is, input data are not
  6757.         transformed at all.
  6758.   -n: Draws normals of vertices.
  6759.   -N: Draws normals of polygons.
  6760.   -i: Draws internal edges (created by IRIT) - default is not to
  6761.         display them, and this option will force displaying them as well.
  6762.   -c: Sets depth cueing on. Drawings that are closer to the viewer will
  6763.         be drawn in more intense color.
  6764.   -C: Cache the piecewise linear geometry so curves and surface can
  6765.         be redisplay faster. Purging it will free memory, on the other hand.
  6766.   -m: Provides some more information on the data file(s) parsed.
  6767.   -a: Sets the support of antialiased lines.
  6768.   -g x1,x2,y1,y2: Prescribes the position and location of the
  6769.         transformation window by prescribing the domain of the window in
  6770.         screen space pixels.
  6771.   -G x1,x2,y1,y2: Prescribes the position and location of the
  6772.         viewing window by prescribing the domain of the window in
  6773.         screen space pixels.
  6774.   -I #IsoLines: Specifies number of isolines per surface, per direction.
  6775.         A specification of zero isolines is possible only on the command line
  6776.         and it denotes the obvious.
  6777.   -F PolyOpti FineNess: Controls the method used to approximate surfaces
  6778.         into polygons. See the variable POLY_APPROX_OPT for the meaning of
  6779.         FineNess. See also -4.
  6780.   -f PolyOpti SampTol: Controls the method used to approximate curves
  6781.         into polylines. If PolyOpti == 0, equally spaced intervals are
  6782.         used. For PolyOpti == 1, an adaptive subdivision that optimizes the
  6783.         samples is employed.  For PolyOpti == 2, SampTol (real number)
  6784.         specifies the maximal allowed deviation tolerance of the piecewise
  6785.         linear approximation from the original curve.
  6786.         Default is 0 64 (uniform sampling with 64 samples).
  6787.   -l LineWidth: Sets the linewidth, in pixels. Default is one pixel wide.
  6788.   -r: Rendered mode. Draws object as solid.
  6789.   -A Shader: Shader can be one of 1 (Flat), 2 (Gouraud), or 3 (Phong).
  6790.   -B: Back face culling of polygons.
  6791.   -2: Double buffering. Prevents screen flicker on the expense of
  6792.         possibly less colors.
  6793.   -d: Debug objects. Prints to stderr all objects read from communcation
  6794.         port with the server IRIT. 
  6795.   -D: Debug input. Prints to stderr all characters read from communcation
  6796.         port with the server IRIT. Lowest level of communication.
  6797.   -L NormalLen: Sets the length of the drawn normals in thousandths of
  6798.         a unit.
  6799.   -4: Forces four polygons per almost flat region in the surface to
  6800.         polygon conversion. Otherwise two polygons only.
  6801.   -b BackGround: Sets the background color as three RGB integers in the
  6802.         range of 0 to 255.
  6803.   -S LgtSrcPos: Sets the lighting via the light source position.
  6804.   -Z ZMin ZMax: Sets the near and far Z clipping planes.
  6805.   -M: Draw control mesh/polygon of curves and surfaces, as well.
  6806.   -x ExecAnimCmd: Command to execute as a subprocess every iteration of
  6807.         display of an animation sequence. This command can for example save
  6808.         the display into an image file, saving the animation sequence.
  6809.         One parameter is passed, which is an running index starting from one.
  6810.   -X Min,Max,Dt{,flags}: Executes an animation sequence between
  6811.         Min time to Max time is steps of Dt. If an 's' flag is specified
  6812.         the animation is saved as idividual data files, one per frame, for
  6813.         high quality rendering.  If 'x' flag is given, the display device
  6814.         exists once the animation is complete.
  6815.   -P: Draws curves and surfaces (surfaces are drawn using a set of
  6816.         isocurves, see -I, or polygons, see -f).
  6817.   -z: Prints version number and current defaults.
  6818.  
  6819. Configuration Options
  6820.  
  6821.  The configuration file is read before the command line options are
  6822.  processed. Therefore, all options in this section can be overriden
  6823.  by the appropriate command line option, if any.
  6824.  
  6825.   TransPrefPos: Preferred location (Xmin, YMin, Xmax, Ymax) of the
  6826.         transformation window.
  6827.   ViewPrefPos: Preferred location (Xmin, YMin, Xmax, Ymax) of the
  6828.         viewing window.
  6829.   BackGround: Background color. Same as '-b'.
  6830.   Internal: Draws internal edges. Same as '-i'.
  6831.   LightSrcPos: Sets the location of the (first) light source as a rational
  6832.         four coefficient location. W of zero sets the light source at infinity.
  6833.   ExecAnimCmd: Executes a command each step of animation. Same as '-x'.
  6834.   ExecAnimation: Executes an animation sequence on startup. Same as '-X'.
  6835.   DrawVNormal: Draws normals of vertices. Same as '-n'.
  6836.   DrawPNormal: Draws normals of polygons. Same as '-n'.
  6837.   MoreVerbose: Provides some more information on the data file(s)
  6838.         parsed. Same as '-m'.
  6839.   UnitMatrix: Forces a Unit matrix. That is, input data are not
  6840.         transformed at all. Same as '-u'.
  6841.   DrawSolid: Requests a shaded surface rendering, as opposed to isocurve
  6842.         surface representation.
  6843.   BFaceCull: Requests the removal of back facing polygons, for better
  6844.         visibility.
  6845.   DoubleBuffer: Requests drawing using a double buffer, if any.
  6846.   DebugObjects: Debug objects. Prints to stderr all objects read
  6847.         from the communcation port with the server IRIT. Same as '-d'.
  6848.   DebugEchoInput: Debug input. Prints to stderr all characters read
  6849.         from the communcation port with the server IRIT. Lowest level of
  6850.         communications.
  6851.   DepthCue: Set depth cueing on. Drawings that are closer to the
  6852.         viewer will be drawn in more intense color. Same as '-c'.
  6853.   CacheGeom: Normally piecewise linear approximation of freefroms is
  6854.         cached. By setting this option to FALSE, no such auxiliary data is
  6855.         being saved, reducing the memory overhead. Same as '-C'.
  6856.   FourPerFlat: Forces four polygons per almost flat region in the
  6857.         surface to polygon conversion. Otherwise two polygons only. Same as
  6858.         '-4'.
  6859.   AntiAlias: Request the drawing of anti aliased lines.
  6860.   DrawSurfaceMesh: Draws control mesh/polygon of curves and surfaces,
  6861.         as well. Same as '-M'.
  6862.   DrawSurfacePoly: Draws curves and surfaces (surfaces are drawn using
  6863.         a set of isocurves, see -I, or polygons, see -f). Same as '-P'.
  6864.   StandAlone: Runs the driver in a Stand alone mode. Otherwise, the
  6865.         driver will attempt to communicate with the IRIT server. Same
  6866.         as '-s'.
  6867.   NumOfIsolines:  Specifies number of isolines per surface, per
  6868.         direction. Same as '-I'.
  6869.   SamplesPerCurve: Specifies the samples per (iso)curve. See '-f'.
  6870.   LineWidth: Sets the linewidth, in pixels. Default is one pixel
  6871.        wide. Same as '-l'
  6872.   AdapIsoDir: Selects the direction of the adaptive isoline
  6873.         rendering.
  6874.   PolygonOpti: Controls the method used to subdivide a surface into
  6875.         polygons that approximate it. Same as '-F'.
  6876.   PolylineOpti: Controls the method used to subdivide a curve into
  6877.         polylines that approximate it. Same as '-f'.
  6878.   ShadingModel: One of 1 (Flat), 2 (Gouraud), or 3 (Phong). Same as
  6879.         '-A'.
  6880.   TransMode: Selects between object space transformations and screen
  6881.         space transformation.
  6882.   ViewMode: Selects between perspective and orthographic views.
  6883.   NormalLength: Sets the length of the drawn normals in thousandths of
  6884.         a unit. Same as '-L'.
  6885.   ZClipMin: Sets the minimal clipping plane in Z. Same as '-Z'.
  6886.   ZClipMax: Sets the maximal clipping plane in Z. Same as '-Z'.
  6887.   FineNess: Controls the fineness of the surface to polygon subdivision.
  6888.         See '-F'.
  6889.  
  6890.  
  6891.    Commands that affect the status of the display device can also be sent
  6892.  via the communication port with the IRIT server. The following commands
  6893.  are recognized as string objects with object name of "COMMAND_":
  6894.  
  6895.     BEEP                 Makes some sound. 
  6896.     CLEAR                Clears the display area. All objects are deleted.
  6897.     DCLEAR               Delayed clear. Same as CLEAR but delayed until next
  6898.                          object is sent from the server. Useful for animation.
  6899.     DISCONNECT           Closes connection with the server, but does not quit.
  6900.     EXIT                 Closes connection with the server and quits.
  6901.     GETOBJ NAME          Requests the object named NAME that is returned
  6902.                          in the output channel to the server.
  6903.     MSAVE NAME           Saves the transformation matrix file by the name
  6904.    
  6905.                      NAME.             
  6906.     REMOVE NAME          Request the removal of object named NAME from
  6907.    
  6908.                      display.          
  6909.     ANIMATE TMin TMax Dt  Animates current scene from TMin to TMax in Dt
  6910.    
  6911.                      steps.            
  6912.     STATE COMMAND        Changes the state of the display device. See below.
  6913.  
  6914.    The following commands are valid for the STATE COMMAND above,
  6915.  
  6916.     MoreSense:        More sensitive mouse control.
  6917.     LessSense:        Less sensitive mouse control.
  6918.     ScrnObject:       Toggle screen/object transformation mode.
  6919.     PerspOrtho:       Toggles perspective/orthographic trans. mode.
  6920.     DepthCue:         Toggles depth cueing drawing.
  6921.     DrawSolid:        Toggles isocurve/shaded solid drawing.
  6922.     ShadingMdl:       Toggles shading model for solid solid drawing.
  6923.     BFaceCull:        Cull back facing polygons.
  6924.     DblBuffer:        Toggles single/double buffer mode.
  6925.     AntiAlias:        Toggles anti aliased lines.
  6926.     DrawIntrnl:       Toggles drawing of internal lines.
  6927.     DrawVNrml:        Toggles drawing of normals of vertices.
  6928.     DrawPNrml:        Toggles drawing of normals of polygons.
  6929.     DSrfMesh:         Toggles drawing of control meshes/polygons.
  6930.     DSrfPoly:         Toggles drawing of curves/surfaces.
  6931.     4PerFlat:         Toggles 2/4 polygons per flat surface regions.
  6932.     MoreIso:          Doubles the number of isolines in a surface.
  6933.     LessIso:          Halves the number of isolines in a surface.
  6934.     FinrAprx:         Doubles the number of samples per curve.
  6935.     CrsrAprx:         Halves the number of samples per curve.
  6936.     LngrVecs:         Doubles the length of displayed normal vectors.
  6937.     ShrtrVecs:        Halves the length of displayed normal vectors.
  6938.     WiderLns:         Doubles the width of the drawn lines.
  6939.     NarrwLns:         Halves the width of the drawn lines.
  6940.     WiderPts:         Doubles the width of the cross of drawn points.
  6941.     NarrwPts:         Halves the width of the cross of drawn points.
  6942.     FinrAdapIso:      Doubles the number of adaptive isocurves.
  6943.     CrsrAdapIso:      Halves the number of adaptive isocurves.
  6944.     FinerRld:         Doubles number of ruled surfaces in adaptive isocurves.
  6945.     CrsrRld:          Halves number of ruled surfaces in adaptive isocurves.
  6946.     RuledSrfApx:      Toggles ruled surface approx. in adaptive isocurves.
  6947.     AdapIsoDir:       Toggles the row/col direction of adaptive isocurves.
  6948.     Front:            Selects a front view.
  6949.     Side:             Selects a side view.
  6950.     Top:              Selects a top view.
  6951.     Isometry:         Selects an isometric view.
  6952.     Clear:            Clears the viewing area.
  6953.  
  6954.  Obviously not all state options are valid for all drivers.
  6955.    The IRIT server defines in iritinit.irt several user-defined
  6956.  functions that exercise some of the above state commands, such as
  6957.  VIEWSTATE and VIEWSAVE.
  6958.  
  6959.    In addition to state modification via communication with the IRIT
  6960.  server, modes can be interactively modified on most of the display devices
  6961.  using a pop-up menu that is activated using the right button in the
  6962.  transformation window}.
  6963.    This pop up menu is somewhat different in different drivers, but its
  6964.  entries closely follow the entries of the above state command table.
  6965.  
  6966.  
  6967.    All the display drivers are now able to animate objects with animation
  6968.  curves' attributes on them. For more on the way animation curves can be
  6969.  created see the Animation Section of this manual
  6970.  
  6971.    Once a scene with animation curves' attributes is being loaded into
  6972.  a display device, one can enter "animation" mode using the "Animation"
  6973.  button available in all display devices. The user is then prompt (either
  6974.  graphically or in a textual based interface) for the starting time,
  6975.  termination time and step size of the animation. The parameter space of
  6976.  the animation curve is serving as the time domain. The default staring
  6977.  and terminating times are set as the minimal and maximal parametric
  6978.  domain values of all animation curves. An object at time t below the
  6979.  minimal parametric value will be placed at the starting value of the
  6980.  animation curve. Similarly, an object at time t above the
  6981.  maximal parametric value will be placed at the termination value of the
  6982.  animation curve. The user can also set a bouncing back and forth mode,
  6983.  the number of repetitions, and if desired, request the saving of all
  6984.  the different scenes in the animation as seperate files so a high quality
  6985.  animation can be created.
  6986.  
  6987.  
  6988.    The x11drvs supports the following X Defaults (searched at ~/.Xdefaults):
  6989.         #ifndef COLOR
  6990.         irit*MaxColors:                    1
  6991.         irit*Trans*BackGround:             Black
  6992.         irit*Trans*BorderColor:            White
  6993.         irit*Trans*TextColor:              White
  6994.         irit*Trans*SubWin*BackGround:      Black
  6995.         irit*Trans*SubWin*BorderColor:     White
  6996.         irit*Trans*CursorColor:            White
  6997.         irit*View*BackGround:              Black
  6998.         irit*View*BorderColor:             White
  6999.         irit*View*CursorColor:             White
  7000.         #else
  7001.         irit*MaxColors:                    15
  7002.         irit*Trans*BackGround:             NavyBlue
  7003.         irit*Trans*BorderColor:            Red
  7004.         irit*Trans*TextColor:              Yellow
  7005.         irit*Trans*SubWin*BackGround:      DarkGreen
  7006.         irit*Trans*SubWin*BorderColor:     Magenta
  7007.         irit*Trans*CursorColor:            Green
  7008.         irit*View*BackGround:              NavyBlue
  7009.         irit*View*BorderColor:             Red
  7010.         irit*View*CursorColor:             Red
  7011.         #endif
  7012.         irit*Trans*BorderWidth:            3
  7013.         irit*Trans*Geometry:               =150x500+510+0
  7014.         irit*View*BorderWidth:             3
  7015.         irit*View*Geometry:                =500x500+0+0
  7016.  The Motif-based display drivers contain three types of gadgets which can be
  7017.  operated in the following manner. Scales: can be dragged or clicked outside
  7018.  button for single (mouse's middle button) or continuous (mouse's left
  7019.  button) action. Pushbuttons: activated by clicking the mouse's left button.
  7020.  The control panel: allowes rotation, translation of the objects in three
  7021.  axes, determine perspective ratio, viewing object from top, side, front or
  7022.  isometrically, determining scale factor and clipping settings, and operate
  7023.  the matrix stack. 
  7024.  
  7025.    The environment window toggles between screen or object transformation,
  7026.  depth cue on or off, orthographic or perspective projection, wireframe or
  7027.  solid display, single or double buffering, showing or hiding normals,
  7028.  including or excluding the surface;s mesh and curve;s control polygon,
  7029.  surface drawing using isolines or polygons, and four or two polygons per
  7030.  flat patch. Same display devices allow for the inclusion or exclusion of
  7031.  internal edges, and enable or disable of antialiased lines.
  7032.  Scales in the X11/Motif based devices set normals length, lines width,
  7033.  control sensitivity, the number of islolines and samples, etc.
  7034.    The locations of windows as set via [-g] and [-G] and/or via the
  7035.  configuration file overwrites in x11drvs the Geometry X11 defaults.
  7036.  To use the Geometry X11 default use '-G " "' and '-g " "' or set the
  7037.  string to empty size in the configuration file.
  7038.    In os2drvs, only -G is used to specify the dimensions of the parent window
  7039.  that holds both the viewing and the transformation window.
  7040.    In os2drvs, the following key strokes are available as short cuts:
  7041.  
  7042.     Key        Function
  7043.     ^x         Quit    
  7044.     ^s         Save    
  7045.     ^f         Front View
  7046.     ^d         Side View
  7047.     ^t         Top View
  7048.     ^i         Isometric VIew
  7049.     ^p         Perspetive/Orthographic
  7050.     ^n         View Internal Edges
  7051.     ^v         View Vertices' Normals
  7052.     ^g         View Polygons' Normals
  7053.     ^b         Backface Culling
  7054.     ^c         Depth Cue
  7055.     ^m         View Control Mesh/Poly
  7056.  
  7057.  
  7058.  
  7059.  xglmdrvs -z
  7060.  
  7061.  prints all the options and their current values.
  7062.  
  7063.  xglmdrvs -B -i -l 3 solid1.dat
  7064.  
  7065.  displays the model of solid1.dat using back face culling ('-B'), with
  7066.  internal edges ('-i'), and line width of 3.
  7067.  
  7068.  xglmdrvs -r -A flat wiggle.dat
  7069.  
  7070.  displays the model of wiggle.dat shaded ('-r') using flat shading ('-A').
  7071.  
  7072.  xglmdrvs -I 40 -u -b 255 255 255 wiggle.dat
  7073.  
  7074.  displays the model of wiggle.dat using isolines' density of 40 ('-I'), using
  7075.  unit matrix to begin with ('-u'), and a white background ('-b').
  7076.  
  7077.  xglmdrvs -X 0,2,0.1,sx -r anim.dat
  7078.  
  7079.  executes the animation in anim.dat, from time 0 to time 2 in steps of 0.1.
  7080.  The animation is saved in one frame per file (flag 's' in '-X') and
  7081.  the display device exists once the animation has terminated (flag 'x'
  7082.  in '-X')).  The animation will be shaded ('-r').
  7083. $
  7084.  
  7085.  
  7086. Utilities - General Usage
  7087.  
  7088.    The IRIT solid modeler is accompanied by quite a few utilities. They
  7089.  can be subdivided into two major groups. The first includes auxiliary tools
  7090.  such as illustrt and poly3d-h. The second includes filters such as irit2ray
  7091.  and irit2ps.
  7092.  
  7093.    All these tools operate on input files, and most of the time produce
  7094.  data files. In all utilities that read files, the dash ('-') can be used
  7095.  to read stdin.
  7096.  
  7097.  Example:
  7098.  
  7099.  poly3d-h solid1.dat | irit2ps - > solid1.ps
  7100.  
  7101.    All the utilities have command line options. If an option is set by a '-x'
  7102.  then '-x-' resets the option. The command line options overwrite the settings
  7103.  in config files, and the reset option is useful for cases where the option
  7104.  is set by default, in the configuration file.
  7105.  
  7106.    All utilities can read a sequence of data files. However, the last
  7107.  transformation matrices found (VIEW_MAT and PRSP_MAT) are actually used.
  7108.  
  7109.  Example:
  7110.  
  7111.  poly3d-h solid1.dat | x11drvs solid1.dat - solid1.mat 
  7112.  
  7113.  x11drvs will display the original solid1.dat file with its hidden version,
  7114.  as computed by poly3d-h, all with the solid1.mat, ignoring all other matrices
  7115.  in the data stream.
  7116.  
  7117.  Under unix, compressed files with a postfix ".Z" will be automatically
  7118.  uncompressed on read and write. The following is legal under unix,
  7119.  
  7120.  poly3d-h solid1.dat.Z | x11drvs solid1.dat.Z - solid1.mat
  7121.  
  7122.  where solid1.dat.Z was saved from within IRIT using the command
  7123.  
  7124.  save( "solid1.dat.Z", solid1 );
  7125.  
  7126.  or similar. The unix system's "compress" and "zcat" are used for the purpose
  7127.  of (un)compressing the data via pipes. See also SAVE and LOAD.
  7128. $
  7129.  
  7130.  
  7131. Poly3d-h - Hidden Line Removing Program
  7132.  
  7133.  
  7134.  
  7135.  
  7136.     poly3d-h is a program to remove hidden lines from a given polygonal model.
  7137.  Freeform objects are preprocessed into polygons with controlled fineness.
  7138.  
  7139.     The program performs 4 passes over the input:
  7140.  
  7141.  1. Preprocesses and maps all polygons in a scene, and sorts them.
  7142.  
  7143.  2. Generates edges out of the polygonal model and sorts them (preprocessing
  7144.     for the scan line algorithm) into buckets.
  7145.  
  7146.  3. Intersects edges, and splits edges with non-homogeneous visibility (the
  7147.     scan line algorithm).
  7148.  
  7149.  4. Applies a visibility test of each edge.
  7150.  
  7151.         This program can handle CONVEX polygons only. From IRIT one can
  7152.  ensure that a model consists of convex polygons only using the CONVEX command:
  7153.   CnvxObj = convex( Obj );
  7154.  just before saving it into a file. Surfaces are always decomposed into
  7155.  triangles.
  7156.  
  7157.     poly3d-h output is in the form of polylines. It is a regular IRIT data
  7158.  file that can be viewed using any of the display devices, for example.
  7159.  
  7160.  
  7161.  poly3d-h [-b] [-m] [-i] [-e #Edges] [-H] [-4] [-W Width]
  7162.         [-F PolyOpti FineNess] [-q] [-o OutName] [-t AnimTime]
  7163.         [-c] [-z] DFiles > OutFile
  7164.  
  7165.   -b: BackFacing - if an object is closed (such as most models created by
  7166.        IRIT), back facing polygons can be deleted, therefore speeding up
  7167.        the process by at least a factor of two.
  7168.   -m: More - provides some more information on the data file(s) parsed.
  7169.   -i: Internal edges (created by IRIT) - default is not to
  7170.        display them, and this option will force displaying them as well.
  7171.   -e n: Number of edges to use from each given polygon (default all).
  7172.        Handy as '-e 1 -4' for freeform data.
  7173.   -H: Dumps both visible lines and hidden lines as separated objects.
  7174.        Hidden lines will be dumped using a different (dimmer) color and (a
  7175.        narrower) line width.
  7176.   -4: Forces four polygons per almost flat region in the surface to
  7177.        polygon conversion. Otherwise two polygons only.
  7178.   -W Width: Selects a default width for visible lines in inches.
  7179.   -F PolyOpti FineNess: Optimality of polygonal approximation of
  7180.        surfaces. See the variable POLY_APPROX_OPT for the meaning of
  7181.        FineNess. See also -4.
  7182.   -q: Quiet mode. No printing aside from fatal errors. Disables -m.
  7183.   -o OutName: Name of output file. Default is stdout.
  7184.   -t AnimTime: If the data contains animation curves, evaluate and
  7185.        process the scene at time AnimTime.
  7186.   -z: Prints version number and current defaults.
  7187.   -c: Clips data to screen (default). If disabled ('-c-'), data
  7188.        outside the view screen ([-1, 1] in x and y) are also processed.
  7189.  
  7190.    Some of the options may be turned on in poly3d-h.cfg. They can be then
  7191.  turned off in the command line as '-?-'.
  7192.  
  7193.  
  7194.    The program can be configured using a configuration file named poly3d-h.cfg.
  7195.    This is a plain ASCII file you can edit directly and set the parameters
  7196.  according to the comments there. 'poly3d-h -z' will display the current
  7197.  configuration as read from the configuration file.
  7198.  
  7199.    The configuration file is searched in the directory specified by the
  7200.  IRIT_PATH environment variable. For example,
  7201.  'setenv IRIT_PATH /u/gershon/irit/bin/'.
  7202.    If the IRIT_PATH variable is not set, the current directory is searched.
  7203.  
  7204.  
  7205.    As this program is not interactive, usage is quite simple, and the only
  7206.  control available is using the command line options.
  7207.  
  7208. $
  7209.  
  7210.    If a certain surface should be polygonized into a finer/caurser
  7211.  set of polygons than the rest of the scene, one can set a "resolution"
  7212.  attribute which specifies the relative FineNess resolution of this
  7213.  specific surface. Further, "u_resolution" and "v_resolution" might be
  7214.  similarly used to set relative resolution for the u or v direction only.
  7215.  
  7216.  
  7217. Poly3d-r - A Simple Data Rendering Program
  7218.  
  7219.  Retired. Sources can be found in the contrib directory, but this program is
  7220.  no longer supported. See irender program instead.
  7221. $
  7222.  
  7223. Illustrt - Simple line illustration filter
  7224.  
  7225.  
  7226.  
  7227.  illustrt is a filter that processes IRIT data files and dumps out modified
  7228.  IRIT data files. illustrt can be used to make simple nice illustrations of
  7229.  data. The features of illustrt include depth sorting, hidden line clipping 
  7230.  at intersection points, and vertex enhancements. illustrt is designed to
  7231.  closely interact with irit2ps, although it is not neceessary to use irit2ps
  7232.  on illustrt output.
  7233.  
  7234.  
  7235.  
  7236.    illustrt [-I #IsoLines] [-f PolyOpti SampTol] [-s] [-M] [-P] [-p] [-O]
  7237.             [-l MaxLnLen] [-a] [-t TrimInter] [-o OutName] [-Z InterSameZ]
  7238.             [-m] [-T AnimTime] [-z] DFiles
  7239.  
  7240.   -I #IsoLines: Specifies number of isolines per surface, per direction.
  7241.   -f PolyOpti SampTol: Controls the method used to approximate curves
  7242.         into polylines. If PolyOpti == 0, equally spaced intervals are
  7243.         used. For PolyOpti == 1, an adaptive subdivision that optimizes the
  7244.         samples is employed.  For PolyOpti == 2, SampTol (real number)
  7245.         specifies the maximal allowed deviation tolerance of the piecewise
  7246.         linear approximation from the original curve.
  7247.         Default is 0 64 (uniform sampling with 64 samples).
  7248.   -s: sorts the data in Z depth order that emulates hidden line removal
  7249.         once the data are drawn.
  7250.   -M: Dumps the control mesh/polygon as well.
  7251.   -P: Dumps the curve/surface as isocurves.
  7252.   -p: Dumps vertices of polygons/lines as points.
  7253.   -O: Handle polygonal objects as possibly open.  This will generate
  7254.         two identical edges for an edge shared by two adjacent polygons.
  7255.         Can be useful for open or isilated polygons.
  7256.   -l MaxLnLen: breaks long lines into shorter ones with maximal length
  7257.         of MaxLnLen. This option is necessary to achieve good depth depending
  7258.         line width in the '-d' option of irit2ps.
  7259.   -a: takes into account the angle between the two (poly)lines that
  7260.         intersect when computing how much to trim. See also -t.
  7261.   -t TrimInter: Each time two (poly)line segments intersect in the
  7262.         projection plane, the (poly)line that is farther away from the
  7263.         viewer is clipped TrimInter amount from both sides. See also -a.
  7264.   -o OutName: Name of output file. Default is stdout.
  7265.   -Z InterSameZ: The maximal Z depth difference of intersection curves
  7266.         to be be considered invalid.
  7267.   -m: More talkative mode. Prints processing information.
  7268.   -T AnimTime: If the data contains animation curves, evaluate and
  7269.        process the scene at time AnimTime.
  7270.   -z: Prints version number and current defaults.
  7271.  
  7272.  
  7273.     illustrt is a simple line illustration tool. It process geometry such
  7274.  as polylines and surfaces and dumps geometry with attributes that will make
  7275.  nice line illustrations. illustrt is geared mainly toward its use with
  7276.  irit2ps to create postscript illustrations. Here is a simple example:
  7277.  
  7278.  illustrt -s -l 0.1 solid1.dat | irit2ps -W 0.05 -d 0.2 0.6 -u - > solid.ps
  7279.  
  7280.  make sure all segments piped into irit2ps are shorter than 0.1 and sort them
  7281.  in order to make sure hidden surface removal is correctly applied. Irit2ps
  7282.  is invoked with depth cueing activated, and a default width of 0.05.
  7283.  
  7284.     illustrt dumps out regular IRIT data files, so output can be handled
  7285.  like any other data set. illustrt does the following processing to the input
  7286.  data set:
  7287.  
  7288.   Converts surfaces to isocurves ('-I' flag) and isocurves and curves to
  7289.   polylines ('-S' flag), and converts polygons to polylines.
  7290.     Polygonal objects are considered closed and even though each edge is
  7291.   shared by two polygons, only a single one is generated.
  7292.   Finds the intersection location in the projection plane of all segments in
  7293.   the input data set and trims away the far segment at both sides of the
  7294.   intersection point by an amount controlled by the '-t' and '-a' flags.
  7295.   Breaks polylines and long lines into short segments, as specified via the
  7296.   '-l' flag, so that width depth cueing can be applied more accurately
  7297.   (see irit2ps's '-d' flag) as well as the Z sorting.
  7298.   Generates vertices of polygons in the input data set as points in output data
  7299.   controlled via the '-p' flag.
  7300.   set.
  7301.   Applies a Z sort to the output data, if '-s', so drawing in order of the data
  7302.   will produce a properly hidden surface removal drawing.
  7303.  
  7304.  Here is a more complex example. Make sure tubular is properly set via
  7305.  "attrib(solid1, "tubular", 0.7);" and invoke:
  7306.  
  7307.  illustrt -s -p -l 0.1 -t 0.05 solid1.dat |
  7308.      irit2ps -W 0.05 -d 0.2 0.6 -p h 0.05 -u - > solid.ps
  7309.  
  7310.  makes sure all segments piped into irit2ps are shorter than 0.1, generates
  7311.  points for the vertices, sorts the data in order to make sure hidden surface
  7312.  removal is correctly applied, and trims the far edge by 0.05 at an
  7313.  intersection point. Irit2ps is invoked with depth cueing activated and a
  7314.  default width of 0.05, points are drawn as hollowed circles of default
  7315.  size 0.05, and lines are drawn tubular.
  7316.  
  7317.  Objects in the input stream that have an attribute by the name of
  7318.  "IllustrtNoProcess" are passed to the output unmodified.
  7319.    Objects in the input stream that have an attribute by the name of
  7320.  "SpeedWave" will have a linear segments added that emulate fast
  7321.  motion with the following attributes,
  7322.  "Randomness,DirX,DirY,DirZ,Len,Dist,LenRandom,DistRandom,Width".
  7323.    Objects in the input stream that have an attribute by the name of
  7324.  "HeatWave" will have a spiral curves added that emulate a heat wave
  7325.  in the +Z axis with the following attributes,
  7326.  "Randomness,Len,Dist,LenRandom,DistRandom,Width".
  7327.  Examples:
  7328.  
  7329.  attrib(Axis, "IllustrtNoProcess", "");
  7330.  attrib(Obj, "SpeedWave", "0.0005,1,0,0,5,3,3,2,0.05");
  7331.  attrib(Obj, "HeatWave", "0.015,0.1,0.03,0.06,0.03,0.002");
  7332. $
  7333.  
  7334.  
  7335. Irender - Simple Scan Line Renderer
  7336.  
  7337.  
  7338.  
  7339.     irender is a program to render IRIT scenes into images. It is
  7340.  a software based Z buffer that is able to create images in few formats.
  7341.  Several of its features includes parametric and volumetric texture mapping,
  7342.  shadow computations, transparency and antialiasing.
  7343.  
  7344.  Freeform objects are preprocessed into polygons with controlled fineness.
  7345.  
  7346.  
  7347.   irender [-z] [-v] [-s XSize YSize] [-a Ambient] [-b R G B] [-B]
  7348.           [-F PolyOpti FineNess] [-f PolyOpti SampTol]
  7349.           [-M Flat/Gouraud/Phong] [-P WMin [WMax]] [-S] [-T] [-t AnimTime]
  7350.           [-A FilterName] [-Z] [-n] [-i rle/ppm] files
  7351.  
  7352.   -z: Prints version number and current defaults.
  7353.   -v: Verbose mode. Prints informative messages as it progresses.
  7354.   -s XSize YSize: Sets the size of the output image, in pixels.
  7355.         Default to 512x512.
  7356.   -a Ambient: Sets the ambient lighting fraction. Between zero (no
  7357.         ambient lighting) and one. Default to 0.2.
  7358.   -b R G B: Sets the background color. Each of thre R,G,B colors is
  7359.         an integer value between zero and 255. Default to black.
  7360.   -B : Apply back face culling. Somewhat faster, but only correct for
  7361.         closed objects. Default is no back face culling.
  7362.   -F PolyOpti FineNess: Optimality of polygonal approximation of
  7363.         surfaces. See the variable POLY_APPROX_OPT for the meaning of
  7364.         FineNess. Default is 0 and 20.0 (no optimal sampling with fineness
  7365.         of 20.0 (real number)).
  7366.   -f PolyOpti SampTol: Controls the method used to approximate curves
  7367.         into polylines. If PolyOpti == 0, equally spaced intervals are
  7368.         used. For PolyOpti == 1, an adaptive subdivision that optimizes the
  7369.         samples is employed.  For PolyOpti == 2, SampTol (real number)
  7370.         specifies the maximal allowed deviation tolerance of the piecewise
  7371.         linear approximation from the original curve.
  7372.         Default is 0 64 (uniform sampling with 64 samples).
  7373.   -M Flat/Gouraud/Phong: Selects the shader to be used. Default to
  7374.         Phong if has normals of vertices, Flat if no normals are found.
  7375.   -P WMin [WMax]: Width of rendered polyline, in pixels. If only
  7376.         WMin is specified, all polylines are set to have WMin width. Otherwise,
  7377.         if WMax is prescribed as well, polylines' width is set to be
  7378.         proportional to their depth with WMax is the width of closest polyline
  7379.         and WMin the farest polyline.
  7380.   -S: Enable shadow computation. No shadows will be rendered without -S.
  7381.   -T: Enable transparency computation. No transparent object will be
  7382.         processed without -T.
  7383.   -t AnimTime: If the data contains animation curves, evaluate and
  7384.        process the scene at time AnimTime.
  7385.   -A FilterName: Selects an antialiasing filter. FilterName can be one
  7386.         of 'none', 'box', 'triangle', 'quadratic', 'cubic', 'catrom',
  7387.         'mitchell', 'gaussian', 'sinc, and 'bessel'. Default is 'none'.
  7388.   -Z: Output will be in the form of Z depth instead of a color image.
  7389.         Output will be 32 bits depth instead of RGBA.
  7390.   -n: Reverses the normals of vertices and planes, globally.
  7391.   -i rle/ppm: Selects output image type. Currently the Utah Raster
  7392.         Toolkit's (URT) rle format is being supported as well as the PPM
  7393.         format.
  7394.  
  7395.    Some of the options may be turned on in irender.cfg. They can be then
  7396.  turned off in the command line as '-?-'.
  7397.  
  7398.  
  7399.    The program can be configured using a configuration file named irender.cfg.
  7400.    This is a plain ASCII file you can edit directly and set the parameters
  7401.  according to the comments there. 'irender -z' will display the current
  7402.  configuration as read from the configuration file.
  7403.  
  7404.    The configuration file is searched in the directory specified by the
  7405.  IRIT_PATH environment variable. For example,
  7406.  'setenv IRIT_PATH /u/gershon/irit/bin/'.
  7407.    If the IRIT_PATH variable is not set, the current directory is searched.
  7408.  
  7409.  
  7410.    As this program is not interactive, usage is quite simple, and the only
  7411.  control available is using the command line options.
  7412.  
  7413.  
  7414.  
  7415.    One can specify several attributes that affect the way the scene is
  7416.  rendered. The attributes can be generated within IRIT.
  7417.  See also the ATTRIB IRIT command.
  7418.  
  7419.    Surface color is controlled in two levels. If the object has an RGB
  7420.  attribute, it is used. Otherwise, a color as set via the IRIT COLOR
  7421.  command is used.
  7422.  
  7423.    If a certain surface should be finer/caurser than the rest of the
  7424.  scene, one can set a "resolution" attribute which specifies the
  7425.  relative FineNess resolution of this specific surface. Further,
  7426.  "u_resolution" and "v_resolution" might be similarly used to set
  7427.  relative resolution for the u or v direction only.
  7428.  
  7429.  Example:
  7430.  
  7431.  attrib( Ball, "rgb", "255,0,0" );
  7432.  color( Sphere, white );
  7433.  
  7434.     The cosine exponent of the phong shader can be set for a specific
  7435.  object via the SRF_COSINE attribute.
  7436.  
  7437.  Example:
  7438.  
  7439.  attrib( Ball, "srf_cosine", 16 );
  7440.    
  7441.     An object can be drawn transparent instead of opaque, if it has a
  7442.  "transp" attribute. A transparent value of one denotes a completely
  7443.  transparent object, while a value of zero means a completely opaque
  7444.  object. Transparent object will be rendered as such if and only if the '-T'
  7445.  command line option is set.
  7446.  
  7447.  Example:
  7448.  
  7449.  attrib( final, "transp", 0.5 );
  7450.  
  7451.  Several types of texture mapping are supported. Parametric texture may be
  7452.  attached to a parametric surface where the prescribed image is mapped onto
  7453.  the rectangular parametric domain of the surface.
  7454.  
  7455.  Example:
  7456.  
  7457.  attrib( Srf1, "ptexture", "checker.ppm" );
  7458.  
  7459.  The program will automatically detected a ppm file from an rle according to
  7460.  the file's name.
  7461.  
  7462.  A second type of texture mapping can be applied to all geometric objects.
  7463.  Herein, a procedural texture mapping is employed.  Current supported
  7464.  textures are:
  7465.  
  7466.  
  7467.     wood           Wood style  
  7468.     marble         Marble style
  7469.     contour        Parallel plane contouring
  7470.     ncontour       Constant normal angle to major axis
  7471.  
  7472.  
  7473.  A second parameter that must be provided for procedural textures is the
  7474.  scaling factor of the texture, which can be either one parameter of uniform
  7475.  scaling or a vector of three coefficients for scaling in x, y, and z. The
  7476.  two parameters are separated by a comma.  For contour style, the scale
  7477.  denotes the spacing of the contouring planes in X, Y and Z.  For ncontour
  7478.  style, the scale also denotes the spacing of the adjacent constant normal
  7479.  contours.  Related attributes are "texture_color" and "texture_width" that
  7480.  supports the color and the width of the textured strokes.
  7481.  
  7482.  Example:
  7483.  
  7484.  attrib( Obj1, "texture", "marble, 2" );
  7485.  attrib( Obj2, "texture", "contour, 1 0.5 2.5" );
  7486.  attrib( Obj2, "texture_width", "0.05" );
  7487.  attrib( Obj2, "texture_color", "255,255,255" );
  7488.  
  7489.  which sets Obj1 to have a marble procedural texture with a uniform
  7490.  scaling factor of 2 and a contouring texture for Obj2 with scaling
  7491.  factors of (1, 0.5, 2.5) in x, y, and z, in white color and width 0.05.
  7492.  
  7493.  In addition, a scalar surface spanning the same parameteric domain as an
  7494.  original surface may be used as texture mapping function.  Herein, the
  7495.  scalar function texture is evaluated at each UV parameter value and is mapped
  7496.  through a color scale to yield the output color.  This type of texture is
  7497.  useful for stress maps or analysis maps on top of freeform surfaces.
  7498.    Several related attributes are supported: "stexture_scale" which prescribes
  7499.  the color scale image (only its first column is employed), and
  7500.  "stexture_bound" that sets the domain that will be clipped to the min max
  7501.  values. Funally, "stexture_func" can hold the functions "sqrt" or "abs"
  7502.  to be applied to the evaluated surface value.
  7503.  
  7504.  Example:
  7505.  
  7506.  attrib( Srf, "stexture", scrvtr( Srf, P1, off ) );
  7507.  attrib( Srf, "stexture_scale", "color_scale.ppm" );
  7508.  attrib( Srf, "stexture_func", "sqrt" );
  7509.  attrib( Srf, "stexture_bound", "0.0 100.0" );
  7510.  
  7511.  where scrvtr computes a scalar field to Srf that represents the
  7512.  sum of the squares of the principle curvatures.  The evaluated scalar
  7513.  texture surface's value is piped through a sqrt function.
  7514.  The first column of the image of color_scale.ppm is used to set
  7515.  the coloring scale for curvature bounds values between 0.0 and 100.0.
  7516.  
  7517.  Both "stexture_scale" and "stexture_bound" are optional.  The default
  7518.  color scale maps the min/max values from blue to red through green. The
  7519.  default scalar surface texture bound is computed as the extreme values of
  7520.  the "stexture" surface.
  7521.  
  7522.  While the program has a default for lighting which is two light sources
  7523.  at opposite directions at (1, 1, 1) and (-1, -1, -1), one can overwrite
  7524.  this default. A POINT_TYPE object with LIGHT_SOURCE attribute denotes
  7525.  a light source.  If irender detects one or more light sources in the
  7526.  input stream, the default light sources are not created. Two types of
  7527.  light sources may be prescribed, a parallel at infinity or a point at
  7528.  finite distance light source, distinguished by a TYPE attribute of
  7529.  either POINT_POS or POINT_INFTY. A point light source can be colored,
  7530.  when an RGB attribute will set its color. A point light source will cast
  7531.  shadows if and only if it has SHADOW attribute (one needs to apply the '-S'
  7532.  command line option as well for rendering shadows). Finally, one can
  7533.  construct two mirrored light sources at opposite directions if TWOLIGHT
  7534.  attribute is added to the light source object.
  7535.  
  7536.  Example:
  7537.  
  7538.     Light1 = point( 0, 0, 10 );
  7539.     attrib( Light1, "light_source", on );
  7540.     attrib( Light1, "shadow", on );
  7541.     attrib( Light1, "rgb", "255,0,0" );
  7542.     attrib( Light1, "type", "point_pos" );
  7543.  
  7544.     Light2 = point( 1, 1, 1 );
  7545.     attrib( Light2, "light_source", on );
  7546.     attrib( Light2, "twolight", on );
  7547.     attrib( Light2, "type", "point_infty" );
  7548.  
  7549.  constructs two lights sources with Light1 with red color positioned
  7550.  at (0, 0, 10) and casting shadows, while Light2 will create two
  7551.  mirrored white parallel lights sources in the direction of (1, 1, 1) and
  7552.  (-1, -1, -1), as is irender's default.
  7553. $
  7554.  
  7555. DAT2BIN - Data To Binary Data file filter
  7556.  
  7557.  
  7558.    dat2bin [-t] [-z] DFiles
  7559.  
  7560.   -t: Dumps data to stdout as text instead of binary.
  7561.   -z: Print version number and current defaults.
  7562.  
  7563.  
  7564.     It may be sometimes desired to convert .dat data files into a binary form,
  7565.  for example, for fast loading of files with large geometry. Binary files can
  7566.  be somewhat larger, are unreadable in editors but are much faster to load in.
  7567.  A binary file must have a '.bdt' file type.
  7568.  
  7569.  Example:
  7570.  
  7571.    dat2bin b58polys.dat > b58polys.bdt
  7572.    dat2bin -t b58polys.bdt | more
  7573.  
  7574.  to convert a text file b58polys.dat into a binary file b58polys.bdt and
  7575.  to view the content of the binary file by converting it back to text. At
  7576.  this time data through pipes must be in text. That is, the following is
  7577.  illegal:
  7578.  
  7579.    dat2bin b58polys.dat | xglmdrvs -
  7580.  
  7581.  It should be remembered that the binary format is not documented and
  7582.  it might change in the future. Moreover, it is machine dependent and can
  7583.  very well may be unreadible between different platforms.
  7584. $
  7585.  
  7586. DAT2IRIT - Data To IRIT file filter
  7587.  
  7588.   Converts '.dat' and '.bdt' data files to '.irt' IRIT scripts.
  7589.  
  7590.  
  7591.    dat2irit [-z] DFiles
  7592.  
  7593.   -z: Print version number and current defaults.
  7594.  
  7595.  
  7596.     It may be sometimes desired to convert .dat data files into a form that
  7597.  can be fed back to IRIT - a '.irt' file. This filter does exactly that.
  7598.  
  7599.  Example:
  7600.  
  7601.    dat2irit b58.dat > b58-new.irt
  7602. $
  7603.  
  7604. DXF2IRIT - DXF (Autocad) To IRIT filter
  7605.  
  7606.  Converts Autocad's, DXF data files into IRIT data files.
  7607.  
  7608.  
  7609.    dxf2irit [-m] [-f] [-o OutName] [-z] DXFFile
  7610.  
  7611.   -m: Provides some more information on the data file(s) parsed.
  7612.   -f: Coerce floating end conditions to constructed freeform surfaces.
  7613.         Default is open end conditions.
  7614.   -o OutName: Name of output file. By default the output goes to
  7615.        stdout.
  7616.   -z: Prints version number and current defaults.
  7617.  
  7618.  
  7619.     dxf2irit converts Autocad's DXF data files into IRIT data files.  The
  7620.  current version provides only partial support for the conversion of
  7621.  freeform surfaces, mainly due to luck of documentation examples on the
  7622.  dxf format and the convoluted way freeform surfaces are saved.
  7623.  
  7624.  Example:
  7625.  
  7626.  dxf2irit file.dxf > file.dat
  7627. $
  7628.  
  7629. IRIT2DXF - IRIT To DXF (Autocad) filter
  7630.  
  7631.  Converts IRIT data files into Autocad's, DXF data files.
  7632.  
  7633.  
  7634.     irit2dxf [-s Scale] [-t Tx Ty Tz] [-i] [-f] [-F PolyOpti FineNess]
  7635.              [-4] [-o OutName] [-T] [-a AnimTime] [-z] DFiles
  7636.  
  7637.   -s Scale: Global scaling factor of the converted geometry.
  7638.   -t Tx Ty Tz: a Vector of size three of translation factors along
  7639.         the X, Y, and Z axes.
  7640.   -i: Show internal edges as well.
  7641.   -f: Dumps freeforms as converted polygonal geometry.
  7642.   -F PolyOpti FineNess: Optimality of polygonal approximation of
  7643.        surfaces. See the variable POLY_APPROX_OPT for the meaning of
  7644.        FineNess. See also -4.
  7645.   -4: Forces four polygons per almost flat region in the surface to
  7646.        polygon conversion. Otherwise two polygons only.
  7647.   -o OutName: Name of output file. By default the output goes to
  7648.        stdout.
  7649.   -T: Talkative mode. Prints processing information.
  7650.   -a AnimTime: If the data contains animation curves, evaluate and
  7651.        process the scene at time AnimTime.
  7652.   -z: Prints version number and current defaults.
  7653.  
  7654.  
  7655.     irit2dxf converts IRIT data files into Autocad's DXF data files.  The
  7656.  current version provides only partial support for the direct conversion of
  7657.  freeform surfaces, mainly due to luck of documentation examples on the
  7658.  dxf format and the convoluted way freeform surfaces are saved.  Nonetheless,
  7659.  Freeform surfaces can be converted into polygons using the '-f' flag.
  7660.  
  7661.  Example:
  7662.  
  7663.  irit2dxf -z -t 1 2 3 -F 0 20 -4 -o file.dxf file.dat
  7664. $
  7665.  
  7666. IRIT2Hgl - IRIT To HPGL filter
  7667.  
  7668.  Converts IRIT geometry into the HL Graphics Language used by HP's plotters.
  7669.  
  7670.  
  7671.   irit2hgl [-t XTrans YTrans] [-I #UIso[:#VIso[:#WIso]]]
  7672.        [-f PolyOpti SampTol] [-F PolyOpti FineNess] [-M] [-G] [-T]
  7673.        [-a AnimTime] [-i] [-o OutName] [-z] DFiles
  7674.  
  7675.   -t XTrans YTrans: X and Y translation. of the image. Default is (0, 0).
  7676.   -I #UIso[:#VIso]: Specifies the number of isolines per surface, per
  7677.         direction. If #VIso is not specified, #UIso is used for #VIso as
  7678.         well.
  7679.   -f PolyOpti SampTol: Controls the method used to approximate curves
  7680.         into polylines. If PolyOpti == 0, equally spaced intervals are
  7681.         used. For PolyOpti == 1, an adaptive subdivision that optimizes the
  7682.         samples is employed.  For PolyOpti == 2, SampTol (real number)
  7683.         specifies the maximal allowed deviation tolerance of the piecewise
  7684.         linear approximation from the original curve.
  7685.         Default is 0 64 (uniform sampling with 64 samples).
  7686.   -F PolygonOpti FineNess: Optimality of polygonal approximation of
  7687.         surfaces. See the variable POLY_APPROX_OPT for the meaning of
  7688.         FineNess. See also -4. This enforces the dump of freefrom geometry
  7689.         as polygons.
  7690.   -M: Dumps the control mesh/polygon as well.
  7691.   -G: Dumps the freeform geometry.
  7692.   -T: Talkative mode. Prints processing information.
  7693.   -a AnimTime: If the data contains animation curves, evaluate and
  7694.        process the scene at time AnimTime.
  7695.   -i: Internal edges (created by IRIT) - default is not to
  7696.        display them, and this option will force displaying them as well.
  7697.   -o OutName: Name of output file. By default the name of the first data
  7698.        file from DFiles list is used.  See below on the output files.
  7699.   -z: Prints version number and current defaults.
  7700.  
  7701.  
  7702.     Irit2Hgl converts freeform surfaces and polygons into polylines in a format
  7703.  that can be used by HPGL.
  7704.   
  7705.  Example:
  7706.  
  7707.  irit2Hgl -M -f 0 16 saddle.dat > saddle.hgl
  7708.  
  7709.    However, one can overwrite the viewing matrix by appending a new matrix
  7710.  in the end of the command line, created by the display devices:
  7711.  
  7712.  x11drvs b58.dat
  7713.  irit2Hgl -M -f 0 16 b58.dat irit.mat > saddle.hgl
  7714.  
  7715.  where irit.mat is the viewing matrix created by x11drvs.
  7716. $
  7717.  
  7718. IRIT2IV - IRIT To SGI's Inventor filter
  7719.  
  7720.  IV is the format used by the Inventor modeling/rendering package from SGI.
  7721.  
  7722.  
  7723.   irit2iv [-l] [-4] [-P] [-F PolyOpti FineNess] [-f PolyOpti SampTol]
  7724.                                               [-T] [t AnimTime] [-z] DFiles
  7725.  
  7726.   -l: Linear - forces linear (degree two) surfaces to be approximated
  7727.        by a single polygon along their linear direction.
  7728.        Although, most of the time, linear direction can be exactly represented
  7729.        using a single polygon, even a bilinear surface can have a free form
  7730.        shape (saddle like) that is not representable using a single polygon.
  7731.        Note that although this option will better emulate the surface shape,
  7732.        it will create unnecessary polygons in cases where one is enough.
  7733.   -4: Four - Generates four polygons per flat patch. Default is 2.
  7734.   -P: Polygonize freeform shapes. Default is to leave freeform curves
  7735.        and surfaces as is.
  7736.   -F PolyOpti FineNess: Optimality of polygonal approximation of
  7737.        surfaces. See the variable POLY_APPROX_OPT for the meaning of
  7738.        FineNess. See also -4.
  7739.   -f PolyOpti SampTol: Controls the method used to approximate curves
  7740.         into polylines. If PolyOpti == 0, equally spaced intervals are
  7741.         used. For PolyOpti == 1, an adaptive subdivision that optimizes the
  7742.         samples is employed.  For PolyOpti == 2, SampTol (real number)
  7743.         specifies the maximal allowed deviation tolerance of the piecewise
  7744.         linear approximation from the original curve.
  7745.         Default is 0 64 (uniform sampling with 64 samples).
  7746.   -T: Talkative mode. Prints processing information.
  7747.   -t AnimTime: If the data contains animation curves, evaluate and
  7748.        process the scene at time AnimTime.
  7749.   -z: Prints version number and current defaults.
  7750.  
  7751.  
  7752.     Irit2Iv converts freeform surfaces and polygons into polygons and
  7753.  saved in iv Inventor's ascii file format.
  7754.   
  7755.  Example:
  7756.  
  7757.  irit2iv solid1.dat > solid1.iv
  7758.  
  7759.     Surfaces are converted to polygons with fineness control:
  7760.   
  7761.  irit2iv -F 0 16 - view.mat < saddle.dat > saddle.iv
  7762.  
  7763.     Note the use of '-' for stdin.
  7764. $
  7765.  
  7766. IRIT2NFF - IRIT To NFF filter
  7767.  
  7768.  
  7769.   irit2nff [-l] [-4] [-c] [-F PolyOpti FineNess] [-o OutName] [-T]
  7770.                                            [-t AnimTime] [-g] [-z] DFiles
  7771.  
  7772.   -l: Linear - forces linear (degree two) surfaces to be approximated
  7773.        by a single polygon along their linear direction.
  7774.        Although, most of the time, linear direction can be exactly represented
  7775.        using a single polygon, even a bilinear surface can have a free-form
  7776.        shape (saddle-like) that is not representable using a single polygon.
  7777.        Note that although this option will better emulate the surface shape,
  7778.        it will create unnecessary polygons in cases where one is enough.
  7779.   -4: Four - Generates four polygons per flat patch. Default is 2.
  7780.   -c: Output files should be filtered by cpp. When set, the usually
  7781.        huge geometry file is separated from the main nff file that contains
  7782.        the surface properties and view parameters. By default all data,
  7783.        including the geometry, are saved into a single file with type extension
  7784.        '.nff'. Use of '-c' will pull out all the geometry into a file with
  7785.        the same name but a '.geom' extension, which will be included using the
  7786.        '#include' command. The '.nff' file should, in that case, be
  7787.        preprocessed using cpp before being piped into the nff renderer.
  7788.   -F PolyOpti FineNess: Optimality of polygonal approximation of
  7789.        surfaces. See the variable POLY_APPROX_OPT for the meaning of
  7790.        FineNess. See also -4.
  7791.   -o OutName: Name of output file. By default the name of the first data
  7792.        file from the DFiles list is used.  See below on the output files.
  7793.   -T: Talkative mode. Prints processing information.
  7794.   -t AnimTime: If the data contains animation curves, evaluate and
  7795.        process the scene at time AnimTime.
  7796.   -g: Generates the geometry file only. See below.
  7797.   -z: Prints version number and current defaults.
  7798.  
  7799.  
  7800.     Irit2Nff converts freeform surfaces into polygons in a format that can
  7801.  be used by an NFF renderer. Usually, one file is created with '.nff' type
  7802.  extension. Since the number of polygons can be extremely large, a '-c'
  7803.  option is provided, which separates the geometry from the surface
  7804.  properties and view specification, but requires preprocessing by cpp.
  7805.  The geometry is isolated in a file with extension '.geom' and included
  7806.  (via '#include') in the main '.nff' file. The latter holds the surface
  7807.  properties for all the geometry as well as the viewing specification.
  7808.  This allows for the changing of shading or the viewing properties while
  7809.  editing small ('.nff') files.
  7810.  
  7811.     If '-g' is specified, only the '.geom' file is created, preserving the
  7812.  current '.nff' file. The '-g' flag can be specified only with '-c'.
  7813.  
  7814.     In practice, it may be useful to create a low resolution approximation
  7815.  of the model, change viewing/shading parameters in the '.nff' file until
  7816.  a good view and/or surface quality is found, and then run Irit2Nff once more
  7817.  to create a high resolution approximation of the geometry using '-g'.
  7818.  
  7819.  Example:
  7820.  
  7821.  irit2nff -c -l -F 0 8 b58.dat
  7822.  
  7823.  creates b58.nff and b58.geom with low resolution (FineNess of 5).
  7824.  
  7825.  Once done with parameter setting, a fine approximation of the model can
  7826.  be created with:
  7827.  
  7828.  irit2nff -c -l -g -F 0 64 b58.dat
  7829.  
  7830.  which will only recreate b58.geom (because of the -g option).
  7831.  
  7832.  One can overwrite the viewing matrix by appending a new matrix in the
  7833.  end of the command line, created by a display device:
  7834.  
  7835.  xgldrvs b58.dat
  7836.  irit2nff -l -F 0 32 b58.dat irit.mat
  7837.  
  7838.  where irit.mat is the viewing matrix created by xgldrvs.
  7839.  
  7840.  
  7841.    One can specify surface qualities for individual surfaces of a model.
  7842.  Several such attributes are supported by Irit2Nff and can be set within
  7843.  IRIT. See also the ATTRIB IRIT command.
  7844.  
  7845.    If a certain surface should be finer/caurser than the rest of the
  7846.  scene, one can set a "resolution" attribute which specifies the
  7847.  relative FineNess resolution of this specific surface. Further,
  7848.  "u_resolution" and "v_resolution" might be similarly used to set
  7849.  relative resolution for the u or v direction only.
  7850.  
  7851.  Example:
  7852.  
  7853.  attrib( srf1, "resolution", 2 );
  7854.  
  7855.  will force srf1 to have twice the default resolution, as set via the '-f'
  7856.  flag.
  7857.  
  7858.    Almost flat patches are converted to polygons. The rectangle can be
  7859.  converted into two polygons (by subdividing along one of its diagonals) or
  7860.  into four by introducing a new point at the center of the patch. This
  7861.  behavior is controlled by the '-4' flag, but can be overwritten for
  7862.  individual surfaces by setting a "twoperflat" or a "fourperflat" attribute.
  7863.  
  7864.    NFF specific properties are controlled via the following attributes:
  7865.  "kd", "ks", "shine", "trans", "index". Refer to the NFF manual for detail.
  7866.  
  7867.  Example:
  7868.  
  7869.  attrib( srf1, "kd", 0.3 );
  7870.  attrib( srf1, "shine", 30 );
  7871.  
  7872.    Surface color is controlled in two levels. If the object has an RGB
  7873.  attribute, it is used. Otherwise, a color, as set via the IRIT COLOR
  7874.  command, is used if set.
  7875.  
  7876.  Example:
  7877.  
  7878.  attrib( tankBody, "rgb", "244,164,96" );
  7879. $
  7880.  
  7881. IRIT2PLG - IRIT To PLG (REND386) filter
  7882.  
  7883.  PLG is the format used by the rend386 real time renderer for the IBM PC.
  7884.  
  7885.  
  7886.   irit2plg [-l] [-4] [-F PolyOpti FineNess] [-T] [-z] DFiles
  7887.  
  7888.   -l: Linear - forces linear (degree two) surfaces to be approximated
  7889.        by a single polygon along their linear direction.
  7890.        Although, most of the time, linear direction can be exactly represented
  7891.        using a single polygon, even a bilinear surface can have a free form
  7892.        shape (saddle like) that is not representable using a single polygon.
  7893.        Note that although this option will better emulate the surface shape,
  7894.        it will create unnecessary polygons in cases where one is enough.
  7895.   -4: Four - Generates four polygons per flat patch. Default is 2.
  7896.   -F PolyOpti FineNess: Optimality of polygonal approximation of
  7897.        surfaces. See the variable POLY_APPROX_OPT for the meaning of
  7898.        FineNess. See also -4.
  7899.   -T: Talkative mode. Prints processing information.
  7900.   -z: Prints version number and current defaults.
  7901.  
  7902.  
  7903.     Irit2Plg converts freeform surfaces and polygons into polygons in a
  7904.  format that can be used by the REND386 renderer. 
  7905.   
  7906.  Example:
  7907.  
  7908.  irit2plg solid1.dat > solid1.plg
  7909.  
  7910.     Surfaces are converted to polygons with fineness control:
  7911.   
  7912.  irit2plg -F 0 16 - view.mat < saddle.dat > saddle.plg
  7913.  
  7914.     Note the use of '-' for stdin.
  7915. $
  7916.  
  7917. IRIT2POV - IRIT To POVRAY raytracer filter
  7918.  
  7919.  
  7920.   irit2pov [-l] [-4] [-C] [-F PolyOpti FineNess] [-f PolyOpti SampTol]
  7921.            [-o OutName] [-g] [-p Zmin Zmax] [-P] [-M] [-T] [-t AnimTime]
  7922.            [-I #UIso[:#VIso[:#WIso]]] [-s ObjSeq#] [-z] DFiles
  7923.  
  7924.   -l: Linear - forces linear (degree two) surfaces to be approximated
  7925.         by a single polygon along their linear direction.
  7926.          Although most of the time, linear direction can be exactly represented
  7927.         using a single polygon, even a bilinear surface can have a free-form
  7928.         shape (saddle-like) that is not representable using a single polygon.
  7929.           Note that although this option will better emulate the surface shape,
  7930.         it will create unnecessary polygons in cases where one is enough.
  7931.   -4: Four - Generates four polygons per flat patch. Default is 2.
  7932.   -C: Construct biCubic Bezier patches whenever possible as POVRAY
  7933.         support this type of surface.  Polynomial Bezier surfaces of
  7934.         orders up to and including bicubic (order 4, degree 3) are degree
  7935.         raised to bicubic.  Piecewise polynomials Bspline surfaces are
  7936.         split into Bezier patches.  Higher order surfaces and rational
  7937.         surfaces are always converted into polygons.
  7938.   -F PolygonOpti FineNess: Optimality of polygonal approximation of
  7939.         surfaces. See the variable POLY_APPROX_OPT for the meaning of
  7940.         FineNess. See also -4, -C, and -l.
  7941.   -f PolyOpti SampTol: Controls the method used to approximate curves
  7942.         into polylines. If PolyOpti == 0, equally spaced intervals are
  7943.         used. For PolyOpti == 1, an adaptive subdivision that optimizes the
  7944.         samples is employed.  For PolyOpti == 2, SampTol (real number)
  7945.         specifies the maximal allowed deviation tolerance of the piecewise
  7946.         linear approximation from the original curve.
  7947.         Default is 0 64 (uniform sampling with 64 samples).
  7948.   -o OutName: Name of output file. By default the name of the first data
  7949.         file from the DFiles list is used.  See below on the output
  7950.         files.
  7951.   -g: Generates the geometry file only. See below.
  7952.   -p Zmin Zmax: Sets the ratios between the depth cue and the width of
  7953.         the dumped polylines. See also -P. Closer lines will be drawn
  7954.         wider.
  7955.   -P: Forces dumping polygons as polylines with thickness controlled
  7956.         by -p.
  7957.   -M: If -P (see -P and -p) then converts the control mesh/polygon
  7958.         to polylines which are represented as a sequence of truncated
  7959.         cones.
  7960.   -T: Talkative mode. Prints processing information.
  7961.   -t AnimTime: If the data contains animation curves, evaluate and
  7962.        process the scene at time AnimTime.
  7963.   -I #UIso[:#VIso[:#WIso]]: Specifies the number of isolines per
  7964.         surface/trivariate, per direction. If #VIso or #WIso is not
  7965.         specified, #UIso is used for #VIso etc.
  7966.   -s ObjSeq#: Sets object sequence number if no object name. Default 1.
  7967.   -z: Prints version number and current defaults.
  7968.  
  7969.  
  7970.     Irit2pov converts freeform surfaces into polygons in a format that can
  7971.  be used by the POVRAY ray tracing program.
  7972.  Two files are created, one with a '.geom' extension and
  7973.  one with '.pov'. Since the number of polygons can be extremely large,
  7974.  the geometry is isolated in the '.geom' file and is included
  7975.  (via '#include') in the main '.pov' file. The latter holds the surface
  7976.  properties for all the geometry as well as viewing and POVRAY specific
  7977.  commands. This allows for the changing of the shading or the viewing
  7978.  properties while editing small ('.pov') files.
  7979.  
  7980.     If '-g' is specified, only the '.geom' file is created, preserving the
  7981.  current, possibly manually modified, '.pov' file.
  7982.  
  7983.     In practice, it may be useful to create a low resolution approximation
  7984.  of the model, change the viewing/shading parameters in the '.pov' file until
  7985.  a good view and/or surface quality is found, and then run Irit2pov once more
  7986.  to create a high resolution approximation of the geometry using '-g'.
  7987.  
  7988.  Example:
  7989.  
  7990.  irit2pov -l -F 0 5 b58.dat
  7991.  
  7992.  creates b58.pov and b58.geom with low resolution (FineNess of 5).
  7993.    At such low resolution it can very well may happen that triangles will have
  7994.  normals "over the edge" since a single polygon may approximate a highly
  7995.  curved surface.
  7996.    One can ray trace this scene using a command similar to:
  7997.  
  7998.  POVRAY -Q0 +Ib58
  7999.  
  8000.  Once done with parameter setting for POVRAY, a fine approximation of the
  8001.  model can be created with:
  8002.  
  8003.  irit2pov -l -g -F 0 64 b58.dat
  8004.  
  8005.  which will only recreate b58.geom (because of the -g option).
  8006.  
  8007.  Interesting effects can be created using the depth cue support and polyline
  8008.  conversion of irit2pov. For example
  8009.  
  8010.  irit2pov -P -p -0.0 0.5 solid1.dat
  8011.  
  8012.  will dump solid1 as a set of polylines (represented as truncated cones in
  8013.  POVRAY) with varying thickness according to the z depth. Another example
  8014.  is
  8015.  
  8016.  irit2pov -P -p -0.1 1.0 saddle.dat
  8017.  
  8018.  which dumps the isolines extracted from the saddle surface with varying
  8019.  thickness.
  8020.  
  8021.    Each time a data file is saved in IRIT, it can be saved with the
  8022.  viewing matrix of the last INTERACT by saving the VIEW_MAT object as well.
  8023.  I.e.:
  8024.  
  8025.  save( "b58", b58 );
  8026.  
  8027.    However one can overwrite the viewing matrix by appending a new matrix
  8028.  in the end of the command line, created by the display devices:
  8029.  
  8030.  xglmdrvs b58.dat                        // Creates irit.mat
  8031.  irit2pov -l -F 0 16 b58.dat irit.mat
  8032.  
  8033.  where irit.mat is the viewing matrix created by xglmdrvs. The output name,
  8034.  by default, is the last input file name, so you might want to provide an
  8035.  explicit name with the -o flag.
  8036.  
  8037.  
  8038.    One can specify surface qualities for individual surfaces of a model.
  8039.  Several such attributes are supported by Irit2pov and can be set within
  8040.  IRIT. See also the ATTRIB IRIT command.
  8041.  
  8042.    If a certain surface should be finer/caurser than the rest of the
  8043.  scene, one can set a "resolution" attribute which specifies the
  8044.  relative FineNess resolution of this specific surface. Further,
  8045.  "u_resolution" and "v_resolution" might be similarly used to set
  8046.  relative resolution for the u or v direction only.
  8047.  
  8048.  Example:
  8049.  
  8050.  attrib( srf1, "resolution", 2 );
  8051.  
  8052.  will force srf1 to have twice the default resolution, as set via the '-f'
  8053.  flag.
  8054.  
  8055.    Almost flat patches are converted to polygons. The rectangle can be
  8056.  converted into two polygons (by subdividing along one of its diagonals) or
  8057.  into four by introducing a new point at the patch center. This behavior is
  8058.  controlled by the '-4' flag, but can be overwritten for individual surfaces
  8059.  bu setting "twoperflat" or "fourperflat".
  8060.  
  8061.    POVRAY also supports bicubic Bezier patches and the '-C' option of 
  8062.  irit2pov supports that.  In such a case, the resolution that is requested
  8063.  from POVRAY to polygonize these patches approximately follow the resolution
  8064.  as selected via the '-F' flag of irit2pov.  Nevertheless, one can
  8065.  override the requested resolution via the "steps", "u_steps", and "v_steps"
  8066.  attributes to irit2pov data files that are transfered directly to
  8067.  POVRAY's bicubic Bezier patches.  The "steps" attributes sets both
  8068.  "u_steps" and "v_steps".
  8069.  
  8070.    POVRAY specific properties are controlled via the following attributes:
  8071.  "ambient", "diffuse", "brilliance", "phong", "phong_size", "specular",
  8072.  "roughness", "metallic", "reflection", "refraction", "ior", "caustics",
  8073.  "fade_distance", "fade_power", "irid", "crand", "texture", "pigment", 
  8074.  "finish", "halo", and "normal. The value of this attributes must be
  8075.  strings as it is copied verbatim. Refer to POVRAY's manual for their
  8076.  exact meaning.
  8077.  
  8078.   Example:
  8079.  
  8080.  attrib( legs, "ambient", "0.1" );
  8081.  attrib( pot, "matallic", "" );
  8082.  attrib( table, "ior", "1.4" );
  8083.  
  8084.    Surface color is controlled in two levels. If the object has an RGB
  8085.  attribute, it is used. Otherwise a color as set via the IRIT COLOR
  8086.  command is being used if set.
  8087.  
  8088.  Example:
  8089.  
  8090.  attrib( tankBody, "rgb", "244,164,96" );
  8091. $
  8092.  
  8093. IRIT2PS - IRIT To PS filter
  8094.  
  8095.  
  8096.   irit2ps [-l] [-4] [-s Size] [-I #UIso[:#VIso[:#WIso]]] [-F PolyOpti FineNess]
  8097.           [-f PolyOpti SampTol] [-M] [-G] [-P] [-W LineWidth]
  8098.           [-w WidenLen WidenWidth] [-b R G B] [-B X1 Y1 X2 Y2] [-c] [-C]
  8099.           [-T] [-t AnimTime] [-i] [-o OutName] [-d [Zmin Zmax]]
  8100.           [-D [Zmin Zmax]] [-p PtType PtSize] [-u] [-z] DFiles
  8101.  
  8102.   -l: Linear - forces linear (degree two) surfaces to be approximated
  8103.         by a single polygon along their linear direction.
  8104.          Although most of the time, linear direction can be exactly represented
  8105.         using a single polygon, even a bilinear surface can have a free-form
  8106.         shape (saddle-like) that is not representable using a single polygon.
  8107.           Note that although this option will better emulate the surface shape,
  8108.         it will create unnecessary polygons in cases where one is enough.
  8109.   -4: Four - Generates four polygons per flat patch. Default is 2.
  8110.   -s Size: Controls the size of the postscript output in inches.
  8111.         Default is to fill the entire screen.
  8112.   -I #UIso[:#VIso[:#WIso]]: Specifies the number of isolines per
  8113.         surface/trivariate, per direction. If #VIso or #WIso is not
  8114.         specified, #UIso is used for #VIso etc.
  8115.   -F PolygonOpti FineNess: Optimality of polygonal approximation of
  8116.         surfaces. See the variable POLY_APPROX_OPT for the meaning of
  8117.         FineNess. See also -4.
  8118.   -f PolyOpti SampTol: Controls the method used to approximate curves
  8119.         into polylines. If PolyOpti == 0, equally spaced intervals are
  8120.         used. For PolyOpti == 1, an adaptive subdivision that optimizes the
  8121.         samples is employed.  For PolyOpti == 2, SampTol (real number)
  8122.         specifies the maximal allowed deviation tolerance of the piecewise
  8123.         linear approximation from the original curve.
  8124.         Default is 0 64 (uniform sampling with 64 samples).
  8125.   -M: Dumps the control mesh/polygon as well.
  8126.   -G: Dumps the curve/surface (as freeform geometry). Default. See -I,
  8127.         -C, -f for control on polyline approximation.
  8128.   -P: Dumps the curve/surface (as polygons). See -F, -l, -4 for control
  8129.         on polygonal approximation.
  8130.   -W #LineWidth: Sets the line drawing width in inches. Default is
  8131.         as thin as possible. This option will overwrite only those objects
  8132.         that do not have a "width" attribute. See also -d. If LineWidth
  8133.         is negative its absolute value is used to scale the current width
  8134.         of the object if has one, or the default width otherwise.
  8135.   -w WidenLen WidenWidth: If end points of polylines should be made
  8136.         wider, and if so to what width.
  8137.   -b R G B: Sets a colored background. RGB are three integers prescribing
  8138.         the Red, Green, and Blue coefficients. if no -c (i.e. a gray level
  8139.         drawing) this color is converted to a gray level using RGB to
  8140.         T.V. Y(IQ) channel conversion.
  8141.   -B X1 Y1 X2 Y2: Clips the drawing area outsize the bounding box
  8142.        from (X1, Y1) to (X2, Y2).
  8143.   -c: Creates a color postscript file.
  8144.   -C: Curve mode. Dumps freeform curves and surfaces as cubic
  8145.        Bezier curves. Higher order curves and surfaces and/or rationals are
  8146.        approximated by cubic Bezier curves. This option generates data
  8147.        files that are roughly a third of piecewise linear postscript files
  8148.        (by disabling this feature, -C-), but takes a longer time to compute.
  8149.   -T: Talkative mode. Prints processing information.
  8150.   -t AnimTime: If the data contains animation curves, evaluate and
  8151.        process the scene at time AnimTime.
  8152.   -i: Internal edges (created by IRIT) - the default is not to
  8153.        display them, and this option will force displaying them as well.
  8154.   -o OutName: Name of output file. Default is stdout.
  8155.   -d [Zmin Zmax]: Sets the ratios between the depth cue and the width of
  8156.         the dumped data. See also -W, -p. Closer lines/points will be drawn
  8157.         wider/larger. Zmin and Zmax are optional. The object's bounding
  8158.         box is otherwise computed and used.
  8159.   -D [Zmin Zmax]: Same as -d, but depth cue the color or gray scale
  8160.         instead of width. You might need to consider the sorting option
  8161.         of the illustrt tool (-s of illustrt) for proper drawings.
  8162.         Only one of -d and -D can be used.
  8163.   -p PtType PtSize: Specifies the way points are drawn.
  8164.         PtType can be one of H, F, C for Hollow circle, Full Circle, or
  8165.         Cross. PtSize specifies the size of the point to be drawn, in inches.
  8166.         Vectors will also be drawn as points, but with an additional thin
  8167.         line to the origin. See also -d.
  8168.   -u: Forces a unit matrix transformation, i.e. no transformation.
  8169.   -z: Prints version number and current defaults.
  8170.  
  8171.  
  8172.     Irit2Ps converts freeform surfaces and polygons into a postscript file.
  8173.   
  8174.  Example:
  8175.  
  8176.  irit2ps solid1.dat > solid1.ps
  8177.  
  8178.     Surfaces are converted to polygons with fineness control:
  8179.   
  8180.  irit2ps -f 0 32 -c -W 0.01 saddle.dat > saddle.ps
  8181.  
  8182.  creates a postscript file for the saddle model, in color, and with
  8183.  lines 0.01 inch thick.
  8184.  
  8185.  
  8186.    One can specify several attributes that affect the way the postscript
  8187.  file is generated. The attributes can be generated within IRIT.
  8188.  See also the ATTRIB IRIT command.
  8189.  
  8190.    If a certain object should be thinner or thicker than the rest of the scene,
  8191.  one can set a "width" attribute which specifies the line width in inches of
  8192.  this specific object.
  8193.  
  8194.  Example:
  8195.  
  8196.  attrib( srf1, "width", 0.02 );
  8197.  
  8198.  will force srf1 to have this width, instead of the default as set via the
  8199.  '-W' flag.
  8200.  
  8201.  If a (closed) object, a polygon for example, needs to be filled, a "fill"
  8202.  attribute should be set, with a value equal to the gray level desired.
  8203.  
  8204.  Example:
  8205.  
  8206.  attrib( poly, "fill", 0.5 );
  8207.  
  8208.  will fill poly with %50 gray.
  8209.  
  8210.  If an object, a polygon for example, needs to be painted in a gray level
  8211.  instead of black, a "gray" attribute should be set, with a value equal
  8212.  to the gray level desired.
  8213.  
  8214.  Example:
  8215.  
  8216.  attrib( poly, "gray", 0.5 );
  8217.  
  8218.  will draw poly with %50 gray.
  8219.  
  8220.  Dotted or dashed line effects can be created using a "dash" attribute which
  8221.  is a direct PostScript dash string. A simple form of this string is "[a b]"
  8222.  in which a is the drawing portion (black) in inches, followed by b inches
  8223.  of white space. See the postScript manual for more about the format of this
  8224.  string. Here is an example for a dotted-dash line.
  8225.  
  8226.  attrib( poly, "dash", "[0.006 0.0015 0.001 0.0015] 0" );
  8227.  
  8228.    Surface color is controlled (for color postscript only - see -c) in two
  8229.  levels. If the object has an RGB attribute, it is used. Otherwise, a color as
  8230.  set via the IRIT COLOR command is used.
  8231.  
  8232.  Example:
  8233.  
  8234.  attrib( Ball, "rgb", "255,0,0" );
  8235.  
  8236.     An object can be drawn as ``tubes'' instead of full lines. The ratio
  8237.  between the inner and the outer radii of the tube is provided as the
  8238.  TUBULAR attribute:
  8239.  
  8240.  attrib( final, "tubular", 0.7 );
  8241. $
  8242.  
  8243. IRIT2RAY - IRIT To RAYSHADE filter
  8244.  
  8245.  
  8246.   irit2ray [-l] [-4] [-G GridSize] [-F PolyOpti FineNess]
  8247.            [-f PolyOpti SampTol] [-o OutName] [-g] [-p Zmin Zmax] [-P]
  8248.            [-M] [-T] [-t AnimTime] [-I #UIso[:#VIso[:#WIso]]] [-s ObjSeq#]
  8249.            [-z] DFiles
  8250.  
  8251.   -l: Linear - forces linear (degree two) surfaces to be approximated
  8252.         by a single polygon along their linear direction.
  8253.          Although most of the time, linear direction can be exactly represented
  8254.         using a single polygon, even a bilinear surface can have a free-form
  8255.         shape (saddle-like) that is not representable using a single polygon.
  8256.           Note that although this option will better emulate the surface shape,
  8257.         it will create unnecessary polygons in cases where one is enough.
  8258.   -4: Four - Generates four polygons per flat patch. Default is 2.
  8259.   -G GridSize: Usually objects are grouped as lists of polygons.
  8260.         This flags will coerce the usage of the RAYSHADE grid structure,
  8261.         with GridSize being used as the grid size along the object
  8262.         bounding box's largest dimension.
  8263.   -F PolygonOpti FineNess: Optimality of polygonal approximation of
  8264.         surfaces. See the variable POLY_APPROX_OPT for the meaning of
  8265.         FineNess. See also -4.
  8266.   -f PolyOpti SampTol: Controls the method used to approximate curves
  8267.         into polylines. If PolyOpti == 0, equally spaced intervals are
  8268.         used. For PolyOpti == 1, an adaptive subdivision that optimizes the
  8269.         samples is employed.  For PolyOpti == 2, SampTol (real number)
  8270.         specifies the maximal allowed deviation tolerance of the piecewise
  8271.         linear approximation from the original curve.
  8272.         Default is 0 64 (uniform sampling with 64 samples).
  8273.   -o OutName: Name of output file. By default the name of the first data
  8274.         file from the DFiles list is used.  See below on the output
  8275.         files.
  8276.   -g: Generates the geometry file only. See below.
  8277.   -p Zmin Zmax: Sets the ratios between the depth cue and the width of
  8278.         the dumped polylines. See also -P. Closer lines will be drawn
  8279.         wider.
  8280.   -P: Forces dumping polygons as polylines with thickness controlled
  8281.         by -p.
  8282.   -M: If -P (see -P and -p) then converts the control mesh/polygon
  8283.         to polylines which are represented as a sequence of truncated
  8284.         cones.
  8285.   -T: Talkative mode. Prints processing information.
  8286.   -t AnimTime: If the data contains animation curves, evaluate and
  8287.        process the scene at time AnimTime.
  8288.   -I #UIso[:#VIso[:#WIso]]: Specifies the number of isolines per
  8289.         surface/trivariate, per direction. If #VIso or #WIso is not
  8290.         specified, #UIso is used for #VIso etc.
  8291.   -s ObjSeq#: Sets object sequence number if no object name. Default 1.
  8292.   -z: Prints version number and current defaults.
  8293.  
  8294.  
  8295.     Irit2Ray converts freeform surfaces into polygons in a format that can
  8296.  be used by the RAYSHADE ray tracing program.
  8297.  Two files are created, one with a '.geom' extension and
  8298.  one with '.ray'. Since the number of polygons can be extremely large,
  8299.  the geometry is isolated in the '.geom' file and is included
  8300.  (via '#include') in the main '.ray' file. The latter holds the surface
  8301.  properties for all the geometry as well as viewing and RAYSHADE specific
  8302.  commands. This allows for the changing of the shading or the viewing
  8303.  properties while editing small ('.ray') files.
  8304.  
  8305.     If '-g' is specified, only the '.geom' file is created, preserving the
  8306.  current '.ray' file.
  8307.  
  8308.     In practice, it may be useful to create a low resolution approximation
  8309.  of the model, change the viewing/shading parameters in the '.ray' file until
  8310.  a good view and/or surface quality is found, and then run Irit2Ray once more
  8311.  to create a high resolution approximation of the geometry using '-g'.
  8312.  
  8313.  Example:
  8314.  
  8315.  irit2ray -l -F 0 5 b58.dat
  8316.  
  8317.  creates b58.ray and b58.geom with low resolution (FineNess of 5).
  8318.    At such low resolution it can very well may happen that triangles will have
  8319.  normals "over the edge" since a single polygon may approximate a highly
  8320.  curved surface. That will cause RAYSHADE to issue an
  8321.  "Inconsistent triangle normals" warning. This problem will not exist if
  8322.  high fineness is used.
  8323.    One can ray trace this scene using a command similar to:
  8324.  
  8325.  RAYSHADE -p -W 256 256 b58.ray > b58.rle
  8326.  
  8327.  Once done with parameter setting for RAYSHADE, a fine approximation of the
  8328.  model can be created with:
  8329.  
  8330.  irit2ray -l -g -F 0 64 b58.dat
  8331.  
  8332.  which will only recreate b58.geom (because of the -g option).
  8333.  
  8334.  Interesting effects can be created using the depth cue support and polyline
  8335.  conversion of irit2ray. For example
  8336.  
  8337.  irit2ray -G 5 -P -p -0.0 0.5 solid1.dat
  8338.  
  8339.  will dump solid1 as a set of polylines (represented as truncated cones in
  8340.  RAYSHADE) with varying thickness according to the z depth. Another example
  8341.  is
  8342.  
  8343.  irit2ray -G 5 -P -p -0.1 1.0 saddle.dat
  8344.  
  8345.  which dumps the isolines extracted from the saddle surface with varying
  8346.  thickness.
  8347.  
  8348.    Each time a data file is saved in IRIT, it can be saved with the
  8349.  viewing matrix of the last INTERACT by saving the VIEW_MAT object as well.
  8350.  I.e.:
  8351.  
  8352.  save( "b58", b58 );
  8353.  
  8354.    However one can overwrite the viewing matrix by appending a new matrix
  8355.  in the end of the command line, created by the display devices:
  8356.  
  8357.  os2drvs b58.dat                        // Creates irit.mat
  8358.  irit2ray -l -F 0 16 b58.dat irit.mat
  8359.  
  8360.  where irit.mat is the viewing matrix created by os2drvs. The output name,
  8361.  by default, is the last input file name, so you might want to provide an
  8362.  explicit name with the -o flag.
  8363.  
  8364.  
  8365.    One can specify surface qualities for individual surfaces of a model.
  8366.  Several such attributes are supported by Irit2Ray and can be set within
  8367.  IRIT. See also the ATTRIB IRIT command.
  8368.  
  8369.    If a certain surface should be finer/caurser than the rest of the
  8370.  scene, one can set a "resolution" attribute which specifies the
  8371.  relative FineNess resolution of this specific surface. Further,
  8372.  "u_resolution" and "v_resolution" might be similarly used to set
  8373.  relative resolution for the u or v direction only.
  8374.  
  8375.  Example:
  8376.  
  8377.  attrib( srf1, "resolution", 2 );
  8378.  
  8379.  will force srf1 to have twice the default resolution, as set via the '-f'
  8380.  flag.
  8381.  
  8382.    Almost flat patches are converted to polygons. The rectangle can be
  8383.  converted into two polygons (by subdividing along one of its diagonals) or
  8384.  into four by introducing a new point at the patch center. This behavior is
  8385.  controlled by the '-4' flag, but can be overwritten for individual surfaces
  8386.  bu setting "twoperflat" or "fourperflat".
  8387.  
  8388.    RAYSHADE specific properties are controlled via the following attributes:
  8389.  "specpow", "reflect", "transp", "body", "index", and "texture". The value of
  8390.  this attributes must be strings as it is copied verbatim. Refer to
  8391.  RAYSHADE's manual for their meaning.
  8392.  
  8393.   Example:
  8394.  
  8395.  attrib( legs, "transp", "0.3" );
  8396.  attrib( legs, "texture", "wood,2" );
  8397.  attrib( table, "texture", "marble" );
  8398.  attrib( table, "reflect", "0.5" );
  8399.  
  8400.    Optional scale can be prescribed to textures. In the above example
  8401.  wooden legs' (that are also transparent...) texture is selected with
  8402.  texture's scaling factor of 2.
  8403.  
  8404.    Surface color is controlled in two levels. If the object has an RGB
  8405.  attribute, it is used. Otherwise a color as set via the IRIT COLOR
  8406.  command is being used if set.
  8407.  
  8408.  Example:
  8409.  
  8410.  attrib( tankBody, "rgb", "244,164,96" );
  8411. $
  8412.  
  8413. IRIT2Scn - IRIT To SCENE (RTrace) filter
  8414.  
  8415.  SCENE is the format used by the RTrace ray tracer. This filter was donated
  8416.  by Antonio Costa (acc@asterix.inescn.pt), the author of RTrace.
  8417.  
  8418.  
  8419.   irit2scn [-l] [-4] [-F PolyOpti FineNess] [-o OutName] [-g] [-T]
  8420.            [-t AnimTime] [-z] DFiles
  8421.  
  8422.   -l: Linear - forces linear (degree two) surfaces to be approximated
  8423.        as a single polygon along their linear direction.
  8424.          Although most of the time, linear direction can be exactly represented
  8425.        using a single polygon, even a bilinear surface can have a free-form
  8426.        shape (saddle-like) that is not representable using a single polygon.
  8427.          Note that although this option will better emulate the surface shape,
  8428.        it will create unnecessary polygons in cases where one is enough.
  8429.   -4: Four - Generates four polygons per flat patch.
  8430.   -F PolyOpti FineNess: Optimality of polygonal approximation of
  8431.        surfaces. See the variable POLY_APPROX_OPT for the meaning of
  8432.        FineNess. See also -4.
  8433.   -o OutName: Name of output file. By default the name of the first data
  8434.        file from DFiles list is used.  See below on the output files.
  8435.   -g: Generates the geometry file only. See below.
  8436.   -T: Talkative mode. Prints processing information.
  8437.   -t AnimTime: If the data contains animation curves, evaluate and
  8438.        process the scene at time AnimTime.
  8439.   -z: Prints version number and current defaults.
  8440.  
  8441.  
  8442.     Irit2Scn converts freeform surfaces and polygons into polygons in a format
  8443.  that can be used by RTrace. Two files are created, one with a '.geom'
  8444.  extension and one with '.scn'. Since the number of polygons can be extremely
  8445.  large, the geometry is isolated in the '.geom' file and is included
  8446.  (via '#include') in the main '.scn' file. The latter holds the surface
  8447.  properties for all the geometry as well as viewing and RTrace specific
  8448.  commands. This allows for the changing of the shading or the viewing
  8449.  properties while editing small ('.scn') files.
  8450.  
  8451.     If '-g' is specified, only the '.geom' file is created, preserving the
  8452.  current '.scn' file.
  8453.  
  8454.     In practice, it may be useful to create a low resolution approximation
  8455.  of the model, change the viewing/shading parameters in the '.scn' file
  8456.  until a good view and/or surface quality is found, and then run Irit2Scn once
  8457.  more to create a high resolution approximation of the geometry using '-g'.
  8458.  
  8459.  Example:
  8460.  
  8461.  irit2scn -l -F 0 8 b58.dat
  8462.  
  8463.  creates b58.scn and b58.geom with low resolution (FineNess of 5).
  8464.  
  8465.    One can ray trace this scene after converting the scn file to a sff file,
  8466.  using scn2sff provided with the RTrace package.
  8467.  
  8468.  Once done with the parameter setting of RTrace, a fine approximation of the
  8469.  model can be created with:
  8470.  
  8471.  irit2scn -l -g -F 0 64 b58.dat
  8472.  
  8473.  which will only recreate b58.geom (because of the -g option).
  8474.  
  8475.    One can overwrite the viewing matrix by appending a new matrix
  8476.  in the end of the command line, created by the display devices:
  8477.  
  8478.  wntdrvs b58.dat
  8479.  irit2scn -l -F 0 8 b58.dat irit.mat
  8480.  
  8481.  where irit.mat is the viewing matrix created by wntdrvs. The output name,
  8482.  by default, is the last input file name, so you might want to provide an
  8483.  explicit name with the -o flag.
  8484.  
  8485.  
  8486.    One can specify surface qualities for individual surfaces of a model.
  8487.  Several such attributes are supported by Irit2Scn and can be set within 
  8488.  IRIT. See also the ATTRIB IRIT command.
  8489.  
  8490.    If a certain surface should be finer/caurser than the rest of the
  8491.  scene, one can set a "resolution" attribute which specifies the
  8492.  relative FineNess resolution of this specific surface. Further,
  8493.  "u_resolution" and "v_resolution" might be similarly used to set
  8494.  relative resolution for the u or v direction only.
  8495.  
  8496.  Example:
  8497.  
  8498.  attrib( srf1, "resolution", 2 );
  8499.  
  8500.  will force srf1 to have twice the default resolution, as set via the '-f'
  8501.  flag.
  8502.  
  8503.    Almost flat patches are converted to polygons. The patch can be converted
  8504.  into two polygons (by subdividing along one of its diagonals) or into four
  8505.  by introducing a new point at the patch center. This behavior is controlled
  8506.  by the '-4' flag, but can be overwritten for individual surfaces bu setting
  8507.  "twoperflat" or "fourperflat".
  8508.  
  8509.    RTrace specific properties are controlled via the following attributes:
  8510.  "SCNrefraction", "SCNtexture", "SCNsurface. Refer to the RTrace manual for
  8511.  their meaning.
  8512.  
  8513.  Example:
  8514.  
  8515.  attrib( srf1, "SCNrefraction", 0.3 );
  8516.  
  8517.    Surface color is controlled in two levels. If the object has an RGB
  8518.  attribute, it is used. Otherwise a color as set via IRIT COLOR command
  8519.  is used if set.
  8520.  
  8521.  Example:
  8522.  
  8523.  attrib( tankBody, "rgb", "244,164,96" );
  8524. $
  8525.  
  8526. IRIT2Xfg - IRIT To XFIG filter
  8527.  
  8528.  
  8529.   irit2xfg [-s Size] [-t XTrans YTrans] [-I #UIso[:#VIso[:#WIso]]]
  8530.        [-f PolyOpti SampTol] [-F PolyOpti FineNess] [-M] [-G] [-T]
  8531.        [-a AnimTime] [-i] [-o OutName] [-z] DFiles
  8532.  
  8533.   -s Size: Size in inches of the page. Default is 7 inches.
  8534.   -t XTrans YTrans: X and Y translation. of the image. Default is (0, 0).
  8535.   -I #UIso[:#VIso]: Specifies the number of isolines per surface, per
  8536.         direction. If #VIso is not specified, #UIso is used for #VIso as
  8537.         well.
  8538.   -f PolyOpti SampTol: Controls the method used to approximate curves
  8539.         into polylines. If PolyOpti == 0, equally spaced intervals are
  8540.         used. For PolyOpti == 1, an adaptive subdivision that optimizes the
  8541.         samples is employed.  For PolyOpti == 2, SampTol (real number)
  8542.         specifies the maximal allowed deviation tolerance of the piecewise
  8543.         linear approximation from the original curve.
  8544.         Default is 0 64 (uniform sampling with 64 samples).
  8545.   -F PolygonOpti FineNess: Optimality of polygonal approximation of
  8546.         surfaces. See the variable POLY_APPROX_OPT for the meaning of
  8547.         FineNess. See also -4. This enforces the dump of freefrom geometry
  8548.         as polygons.
  8549.   -M: Dumps the control mesh/polygon as well.
  8550.   -G: Dumps the freeform geometry.
  8551.   -T: Talkative mode. Prints processing information.
  8552.   -a AnimTime: If the data contains animation curves, evaluate and
  8553.        process the scene at time AnimTime.
  8554.   -i: Internal edges (created by IRIT) - default is not to
  8555.        display them, and this option will force displaying them as well.
  8556.   -o OutName: Name of output file. By default the name of the first data
  8557.        file from DFiles list is used.  See below on the output files.
  8558.   -z: Prints version number and current defaults.
  8559.  
  8560.  
  8561.     Irit2Xfg converts freeform surfaces and polygons into polylines in a format
  8562.  that can be used by XFIG.
  8563.   
  8564.  Example:
  8565.  
  8566.  irit2Xfg -T -f 0 16 saddle.dat > saddle.xfg
  8567.  
  8568.    However, one can overwrite the viewing matrix by appending a new matrix
  8569.  in the end of the command line, created by the display devices:
  8570.  
  8571.  x11drvs b58.dat
  8572.  irit2Xfg -T -f 0 16 b58.dat irit.mat > saddle.xfg
  8573.  
  8574.  where irit.mat is the viewing matrix created by x11drvs.
  8575. $
  8576.  
  8577. OBJ2IRIT - Wavefront OBJ format To IRIT data files
  8578.  
  8579.  Converts Waverfront's OBJ data files into IRIT data files.
  8580.  
  8581.  
  8582.     obj2irit [-m] [-o OutName] [-z] OBJFile
  8583.  
  8584.   -m: Provides some more information on the data file(s) parsed.
  8585.   -o OutName: Name of output file. By default the output goes to
  8586.        stdout.
  8587.   -z: Prints version number and current defaults.
  8588.  
  8589.  
  8590.     obj2irit converts Wavefront's OBJ data files into IRIT data files.
  8591.  The current version provides only partial support for the direct conversion
  8592.  of freeform surfaces, mainly due to luck of examples of freeform surfaces
  8593.  in obj format.
  8594.  
  8595.  Example:
  8596.  
  8597.  obj2irit -o file.dat file.obj
  8598. $
  8599.  
  8600. DATAFILE Format
  8601.  
  8602.    This section describes the data file format used to exchange data between
  8603.  IRIT and its accompanying tools.
  8604.  
  8605.  [OBJECT {ATTRS} OBJNAME
  8606.      [NUMBER n]
  8607.  
  8608.    | [VECTOR x y z]
  8609.  
  8610.    | [CTLPT POINT_TYPE {w} x y {z}]
  8611.  
  8612.    | [STRING "a string"]
  8613.  
  8614.    | [MATRIX m00 ... m03
  8615.              m10 ... m13
  8616.              m20 ... m23
  8617.              m30 ... m33]
  8618.  
  8619.      ;A polyline should be drawn from first point to last. Nothing is drawn
  8620.      ;from last to first (in a closed polyline, last point is equal to first).
  8621.    | [POLYLINE {ATTRS} #PTS                   ;#PTS = number of points.
  8622.          [{ATTRS} x y z]
  8623.          [{ATTRS} x y z]
  8624.             .
  8625.             .
  8626.             .
  8627.          [{ATTRS} x y z]
  8628.      ]
  8629.  
  8630.      ;Defines a closed planar region. Last point is NOT equal to first,
  8631.      ;and a line from last point to first should be drawn when the boundary
  8632.      ;of the polygon is drawn.
  8633.    | [POLYGON {ATTRS} #PTS
  8634.          [{ATTRS} x y z]
  8635.          [{ATTRS} x y z]
  8636.             .
  8637.             .
  8638.             .
  8639.          [{ATTRS} x y z]
  8640.      ]
  8641.  
  8642.      ;Defines a "cloud" of points.
  8643.    | [POINTLIST {ATTRS} #PTS
  8644.          [{ATTRS} x y z]
  8645.          [{ATTRS} x y z]
  8646.             .
  8647.             .
  8648.             .
  8649.          [{ATTRS} x y z]
  8650.      ]
  8651.  
  8652.      ;Defines an instance - a geometry reference (by name, SRF13 below)
  8653.      ;and a transformation matrix to apply to this geoemtry
  8654.    | [INSTANCE SRF13
  8655.              m00 ... m03
  8656.              m10 ... m13
  8657.              m20 ... m23
  8658.              m30 ... m33]
  8659.  
  8660.      ;Defines a Bezier curve with #PTS control points. If the curve is
  8661.      ;rational, the rational component is introduced first.
  8662.    | [CURVE BEZIER {ATTRS} #PTS POINT_TYPE
  8663.          [{ATTRS} {w} x y z ...]
  8664.          [{ATTRS} {w} x y z ...]
  8665.             .
  8666.             .
  8667.             .
  8668.          [{ATTRS} {w} x y z ...]
  8669.      ]
  8670.  
  8671.      ;Defines a Bezier surface with #UPTS * #VPTS control points. If the
  8672.      ;surface is rational, the rational component is introduced first.
  8673.      ;Points are printed row after row (#UPTS per row), #VPTS rows.
  8674.    | [SURFACE BEZIER {ATTRS} #UPTS #VPTS POINT_TYPE
  8675.          [{ATTRS} {w} x y z ...]
  8676.          [{ATTRS} {w} x y z ...]
  8677.             .
  8678.             .
  8679.             .
  8680.          [{ATTRS} {w} x y z ...]
  8681.      ]
  8682.  
  8683.      ;Defines a Bezier triangular surface with (#PTS + 1) * #PTS / 2 control
  8684.      ;points, of order ORDER. If the surface is rational, the rational
  8685.      ;component is introduced first. Note #PTS holds number of points along
  8686.      ;an edge and is exactly equal to ORDER. Points are printed sequentially.
  8687.    | [TRISRF BEZIER {ATTRS} #PTS POINT_TYPE
  8688.          [{ATTRS} {w} x y z ...]
  8689.          [{ATTRS} {w} x y z ...]
  8690.             .
  8691.             .
  8692.             .
  8693.          [{ATTRS} {w} x y z ...]
  8694.      ]
  8695.  
  8696.      ;Defines a Bezier trivariate with #UPTS * #VPTS * #WPTS control
  8697.      ;points. If the trivariate is rational, the rational component is
  8698.      ;introduced first. Points are printed row after row (#UPTS per row),
  8699.      ;#VPTS rows, #WPTS layers (depth).
  8700.    | [TRIVAR BEZIER {ATTRS} #UPTS #VPTS #WPTS POINT_TYPE
  8701.          [{ATTRS} {w} x y z ...]
  8702.          [{ATTRS} {w} x y z ...]
  8703.             .
  8704.             .
  8705.             .
  8706.          [{ATTRS} {w} x y z ...]
  8707.      ]
  8708.  
  8709.      ;Defines a Bspline curve of order ORDER with #PTS control points. If the
  8710.      ;curve is rational, the rational component is introduced first.
  8711.      ;Note length of knot vector is equal to #PTS + ORDER.
  8712.      ;If curve is periodic KVP prefix the knot vector that has length of
  8713.      ;'Length + Order + Order - 1'.
  8714.    | [CURVE BSPLINE {ATTRS} #PTS ORDER POINT_TYPE
  8715.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                    ;Knot vector
  8716.          [{ATTRS} {w} x y z ...]
  8717.          [{ATTRS} {w} x y z ...]
  8718.             .
  8719.             .
  8720.             .
  8721.          [{ATTRS} {w} x y z ...]
  8722.      ]
  8723.  
  8724.      ;Defines a Bspline surface with #UPTS * #VPTS control points, of order
  8725.      ;UORDER by VORDER. If the surface is rational, the rational component
  8726.      ;is introduced first.
  8727.      ;Points are printed row after row (#UPTS per row), #VPTS rows.
  8728.      ;If surface is periodic in some direction KVP prefix the knot vector
  8729.      ;that has length of 'Length + Order + Order - 1'.
  8730.    | [SURFACE BSPLINE {ATTRS} #UPTS #VPTS UORDER VORDER POINT_TYPE
  8731.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;U Knot vector
  8732.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;V Knot vector
  8733.          [{ATTRS} {w} x y z ...]
  8734.          [{ATTRS} {w} x y z ...]
  8735.             .
  8736.             .
  8737.             .
  8738.          [{ATTRS} {w} x y z ...]
  8739.      ]
  8740.  
  8741.      ;Defines a Bspline triangular surface with (#PTS + 1) * #PTS / 2 control
  8742.      ;points, of order ORDER. If the surface is rational, the rational
  8743.      ;component is introduced first.
  8744.      ;Points are printed sequentially.
  8745.    | [TRISRF BSPLINE {ATTRS} #PTS ORDER POINT_TYPE
  8746.          [KV {ATTRS} kv0 kv1 kv2 ...]                   ;Knot vector
  8747.          [{ATTRS} {w} x y z ...]
  8748.          [{ATTRS} {w} x y z ...]
  8749.             .
  8750.             .
  8751.             .
  8752.          [{ATTRS} {w} x y z ...]
  8753.      ]
  8754.  
  8755.      ;Defines a Bspline trivariate with #UPTS * #VPTS * #WPTS control
  8756.      ;points. If the trivariate is rational, the rational component is
  8757.      ;introduced first. Points are printed row after row (#UPTS per row),
  8758.      ;#VPTS rows, #WPTS layers (depth).
  8759.      ;If trivariate is periodic in some direction KVP prefix the knot vector
  8760.      ;that has length of 'Length + Order + Order - 1'.
  8761.    | [TRIVAR BSPLINE {ATTRS} #UPTS #VPTS #WPTS UORDER VORDER WORDER POINT_TYPE
  8762.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;U Knot vector
  8763.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;V Knot vector
  8764.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;W Knot vector
  8765.          [{ATTRS} {w} x y z ...]
  8766.          [{ATTRS} {w} x y z ...]
  8767.             .
  8768.             .
  8769.             .
  8770.          [{ATTRS} {w} x y z ...]
  8771.      ]
  8772.  
  8773.      ;Defines a trimmed surface. Encapsulates a surface (can be either a
  8774.      ;Bspline or a Bezier surface) and prescribes its trimming curves.
  8775.      ;There can be an arbitrary number of trimming curves (either Bezier
  8776.      ; or Bspline). Each trimming curve contains an arbitrary number of
  8777.      ;trimming curve segments, while each trimming curve segment contains
  8778.      ;a parameteric representation optionally followed by a Euclidean
  8779.      ;representation of the trimming curve segment.
  8780.    | [TRIMSRF
  8781.          [SURFACE ...
  8782.          ]
  8783.          [TRIMCRV
  8784.              [TRIMCRVSEG
  8785.                  [CURVE ...
  8786.                  ]
  8787.              ]
  8788.                 .
  8789.                 .
  8790.                 .
  8791.              [TRIMCRVSEG
  8792.                  [CURVE ...
  8793.                  ]
  8794.              ]
  8795.          ]
  8796.              .
  8797.              .
  8798.              .
  8799.          [TRIMCRV
  8800.              [TRIMCRVSEG
  8801.                  [CURVE ...
  8802.                  ]
  8803.              ]
  8804.                 .
  8805.                 .
  8806.                 .
  8807.              [TRIMCRVSEG
  8808.                  [CURVE ...
  8809.                  ]
  8810.              ]
  8811.          ]
  8812.      ]
  8813.  ]
  8814.  
  8815.  POINT_TYPE -> E1 | E2 | E3 | E4 | E5 | P1 | P2 | P3 | P4 | P5
  8816.  
  8817.  ATTRS -> [ATTRNAME ATTRVALUE]
  8818.           | [ATTRNAME]
  8819.           | [ATTRNAME ATTRVALUE] ATTRS
  8820.  
  8821.  
  8822.  Some notes:
  8823.  
  8824.  * This definition for the text file is designed to minimize the
  8825.    reading time and space. All information can be read without backward
  8826.    or forward referencing.
  8827.  
  8828.  * An OBJECT must never hold different geometry types or other entities.
  8829.    I.e. CURVEs, SURFACEs, and POLYGONs must all be in different OBJECTs.
  8830.  
  8831.  * Attributes should be ignored if not needed. The attribute list may have
  8832.    any length and is always terminated by a token that is NOT 'verb+[+'. This
  8833.    simplifies and disambiguates the parsing.
  8834.  
  8835.  * Comments may appear between 'verb+[+OBJECT ...verb+]+' blocks, or
  8836.    immediately after OBJECT OBJNAME, and only there.
  8837.  
  8838.    A comment body can be anything not containing the 'verb+[+' or the
  8839.    'verb+]+' tokens (signals start/end of block). Some of the comments in
  8840.    the above definition are illegal and appear there only of the sake
  8841.    of clarity.
  8842.  
  8843.  * It is preferred that geometric attributes such as NORNALs will be saved in
  8844.    the geometry structure level (POLYGON, CURVE or vertices) while graphical
  8845.    and others such as COLORs will be saved in the OBJECT level.
  8846.  
  8847.  * Objects may be contained in other objects to an arbitrary level.
  8848.  
  8849.  Here is an example that exercises most of the data format:
  8850.  
  8851.  This is a legal comment in a data file.
  8852.  [OBJECT DEMO
  8853.      [OBJECT REAL_NUM
  8854.          And this is also a legal comment.
  8855.          [NUMBER 4]
  8856.      ]
  8857.  
  8858.      [OBJECT A_VECTOR
  8859.          [VECTOR 1 2 3]
  8860.      ]
  8861.  
  8862.      [OBJECT CTL_POINT
  8863.          [CTLPT E3 1 2 3]
  8864.      ]
  8865.  
  8866.      [OBJECT STR_OBJ
  8867.          [STRING "string"]
  8868.      ]
  8869.  
  8870.      [OBJECT UNIT_MAT
  8871.          [MATRIX
  8872.             1 0 0 0
  8873.             0 1 0 0
  8874.             0 0 1 0
  8875.             0 0 0 1
  8876.          ]
  8877.      ]
  8878.  
  8879.      [OBJECT [COLOR 4] POLY1OBJ
  8880.          [POLYGON [PLANE 1 0 0 0.5] 4
  8881.              [-0.5 0.5 0.5]
  8882.              [-0.5 -0.5 0.5]
  8883.              [-0.5 -0.5 -0.5]
  8884.              [-0.5 0.5 -0.5]
  8885.          ]
  8886.          [POLYGON [PLANE 0 -1 0 0.5] 4
  8887.              [0.5 0.5 0.5]
  8888.              [-0.5 0.5 0.5]
  8889.              [-0.5 0.5 -0.5]
  8890.              [0.5 0.5 -0.5]
  8891.          ]
  8892.      ]
  8893.  
  8894.      [OBJECT [COLOR 63] ACURVE
  8895.          [CURVE BSPLINE 16 4 E2
  8896.              [KV 0 0 0 0 1 1 1 2 3 4 5 6 7 8 9 10 11 11 11 11]
  8897.              [0.874 0]
  8898.              [0.899333 0.0253333]
  8899.              [0.924667 0.0506667]
  8900.              [0.95 0.076]
  8901.              [0.95 0.76]
  8902.              [0.304 1.52]
  8903.              [0.304 1.9]
  8904.              [0.494 2.09]
  8905.              [0.722 2.242]
  8906.              [0.722 2.318]
  8907.              [0.38 2.508]
  8908.              [0.418 2.698]
  8909.              [0.57 2.812]
  8910.              [0.57 3.42]
  8911.              [0.19 3.572]
  8912.              [0 3.572]
  8913.          ]
  8914.      ]
  8915.  
  8916.      [OBJECT [COLOR 2] SOMESRF
  8917.          [SURFACE BEZIER 3 3 E3
  8918.              [0 0 0]
  8919.              [0.05 0.2 0.1]
  8920.              [0.1 0.05 0.2]
  8921.  
  8922.              [0.1 -0.2 0]
  8923.              [0.15 0.05 0.1]
  8924.              [0.2 -0.1 0.2]
  8925.  
  8926.              [0.2 0 0]
  8927.              [0.25 0.2 0.1]
  8928.              [0.3 0.05 0.2]
  8929.          ]
  8930.      ]
  8931.  ]
  8932. $
  8933.  
  8934. BUGS and LIMITATIONS
  8935.  
  8936.    Like any program of more than one line, it is far from being perfect.
  8937.  Some limitations, as well as simplifications, are laid out below.
  8938.  
  8939.  *  If the intersection curve of two objects falls exactly on polygon
  8940.     boundaries, for all polygons, the system will scream that the two objects
  8941.     do not intersect at all. Try to move one by EPSILON into the other.
  8942.     I probably should fix this one - it is supposed to be relatively easy.
  8943.  
  8944.  *  Avoid degenerate intersections that result with a point or a line.
  8945.     They will probably cause wrong propagation of the inner and outer part of
  8946.     one object relative to the other. Always extend your object beyond the
  8947.     other object.
  8948.  
  8949.  *  If two objects have no intersection in their boundary, IRIT assumes they
  8950.     are disjoint: a union simply combines them, and the other Boolean
  8951.     operators return a NULL object. One should find a FAST way (3D Jordan
  8952.     theorem) to find the relation between the two (A in B, B in A, A
  8953.     disjoint B) and according to that, make a decision.
  8954.  
  8955.  *  Since the boolean sum implementation constructs ruled surfaces with
  8956.     uniform speed, it might return a somewhat incorrect answer, given
  8957.     non-uniform input curves.
  8958.  
  8959.  *  The parser is out of hand and is difficult to maintain. There are several
  8960.     memory leaks there that one should fix.
  8961.  
  8962.  *  The X11 driver has no menu support (any easy way to have menus using
  8963.     Xlib!?).
  8964.  
  8965.  *  IBM R6000 fails to run the drivers in -s- mode.
  8966.  
  8967.  *  Rayshade complains a lot about degenerate polygons on irit2ray output.
  8968.     To alleviate the problem, change the 'equal' macro in common.h in libcommon
  8969.     of rayshade from EPSILON (1e-5) to 1e-7 or even lower.
  8970.  
  8971.  *  On the motif-based drivers (xmtdrvs etc.) clicking the mouse left and
  8972.     right of the scale's button produces stepped transformations. This
  8973.     step size is constant, and is not proportional to the distance between
  8974.     the mouse's position and the position of the button. The reason for the
  8975.     flaw is incorrect callback information returned from the scale in
  8976.     repeattive mode.
  8977.  
  8978.  *  Binary data files are not documented, nor will they be. They might
  8979.     change in the future and are in fact machine dependend. Hence, one
  8980.     platform might fail to read the other's binary data file.
  8981. $
  8982.  
  8983.  
  8984.